diff --git a/pom.xml b/pom.xml index 6d3067b5..0b574119 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,8 @@ 1.2.7 2.1 1.18.6 + 3.5.1 + 3.27.2.1 @@ -242,6 +244,16 @@ ${lombok.version} provided + + org.mybatis + mybatis + ${mybatis.version} + + + org.xerial + sqlite-jdbc + ${sqlite-jdbc.version} + @@ -447,7 +459,15 @@ - + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.6 + + true + true + + \ No newline at end of file diff --git "a/screen_shoot/\345\233\276\345\203\217 198.png" "b/screen_shoot/\345\233\276\345\203\217 198.png" index bed9fc53..b1f42371 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 198.png" and "b/screen_shoot/\345\233\276\345\203\217 198.png" differ diff --git "a/screen_shoot/\345\233\276\345\203\217 199.png" "b/screen_shoot/\345\233\276\345\203\217 199.png" index af6462e1..4918b86b 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 199.png" and "b/screen_shoot/\345\233\276\345\203\217 199.png" differ diff --git "a/screen_shoot/\345\233\276\345\203\217 200.png" "b/screen_shoot/\345\233\276\345\203\217 200.png" index 4c29896a..15aef9ae 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 200.png" and "b/screen_shoot/\345\233\276\345\203\217 200.png" differ diff --git "a/screen_shoot/\345\233\276\345\203\217 202.png" "b/screen_shoot/\345\233\276\345\203\217 202.png" index 034cef6c..07b748e7 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 202.png" and "b/screen_shoot/\345\233\276\345\203\217 202.png" differ diff --git "a/screen_shoot/\345\233\276\345\203\217 204.png" "b/screen_shoot/\345\233\276\345\203\217 204.png" index a8536148..0042944c 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 204.png" and "b/screen_shoot/\345\233\276\345\203\217 204.png" differ diff --git "a/screen_shoot/\345\233\276\345\203\217 205.png" "b/screen_shoot/\345\233\276\345\203\217 205.png" index 2b72c928..e6a23a1c 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 205.png" and "b/screen_shoot/\345\233\276\345\203\217 205.png" differ diff --git "a/screen_shoot/\345\233\276\345\203\217 206.png" "b/screen_shoot/\345\233\276\345\203\217 206.png" index 40c3bc81..1b9697c6 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 206.png" and "b/screen_shoot/\345\233\276\345\203\217 206.png" differ diff --git "a/screen_shoot/\345\233\276\345\203\217 207.png" "b/screen_shoot/\345\233\276\345\203\217 207.png" index 3ffe859d..c8d53474 100644 Binary files "a/screen_shoot/\345\233\276\345\203\217 207.png" and "b/screen_shoot/\345\233\276\345\203\217 207.png" differ diff --git a/src/main/java/com/fangxuele/tool/push/App.java b/src/main/java/com/fangxuele/tool/push/App.java index d68dfb35..3075ad4a 100644 --- a/src/main/java/com/fangxuele/tool/push/App.java +++ b/src/main/java/com/fangxuele/tool/push/App.java @@ -4,6 +4,8 @@ import com.fangxuele.tool.push.ui.form.LoadingForm; import com.fangxuele.tool.push.ui.form.MainWindow; import com.fangxuele.tool.push.ui.frame.MainFrame; +import com.fangxuele.tool.push.util.MybatisUtil; +import org.apache.ibatis.session.SqlSession; import javax.swing.*; @@ -18,6 +20,8 @@ public class App { public static MainFrame mainFrame; + public static SqlSession sqlSession = MybatisUtil.getSqlSession(); + public static void main(String[] args) { Init.initTheme(); mainFrame = new MainFrame(); @@ -25,6 +29,7 @@ public static void main(String[] args) { JPanel loadingPanel = new LoadingForm().getLoadingPanel(); mainFrame.add(loadingPanel); mainFrame.pack(); + mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); mainFrame.setVisible(true); SwingUtilities.invokeLater(() -> { @@ -32,7 +37,8 @@ public static void main(String[] args) { Init.initGlobalFont(); Init.initAllTab(); Init.initOthers(); - mainFrame.setContentPane(MainWindow.mainWindow.mainPanel); + MainWindow.mainWindow.init(); + mainFrame.setContentPane(MainWindow.mainWindow.getMainPanel()); mainFrame.addListeners(); mainFrame.remove(loadingPanel); }); diff --git a/src/main/java/com/fangxuele/tool/push/dao/InitMapper.java b/src/main/java/com/fangxuele/tool/push/dao/InitMapper.java new file mode 100644 index 00000000..d1359532 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/InitMapper.java @@ -0,0 +1,18 @@ +package com.fangxuele.tool.push.dao; + +/** + *
+ * 初始化数据库
+ * 
+ * + * @author RememBerBer + * @since 2019/5/9. + */ +public interface InitMapper { + /** + * 初始化创建所有表 + * + * @return + */ + int createAllTables(); +} diff --git a/src/main/java/com/fangxuele/tool/push/dao/TMsgKefuMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TMsgKefuMapper.java new file mode 100644 index 00000000..7360affa --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TMsgKefuMapper.java @@ -0,0 +1,28 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TMsgKefu; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TMsgKefuMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TMsgKefu record); + + int insertSelective(TMsgKefu record); + + TMsgKefu selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TMsgKefu record); + + int updateByPrimaryKey(TMsgKefu record); + + List selectByMsgTypeAndMsgName(@Param("msgType") int msgType, @Param("msgName") String msgName); + + int updateByMsgTypeAndMsgName(TMsgKefu tMsgKefu); + + List selectByMsgType(int msgType); + + int deleteByMsgTypeAndName(@Param("msgType") int msgType, @Param("msgName") String msgName); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/dao/TMsgKefuPriorityMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TMsgKefuPriorityMapper.java new file mode 100644 index 00000000..0057b9d3 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TMsgKefuPriorityMapper.java @@ -0,0 +1,28 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TMsgKefuPriority; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TMsgKefuPriorityMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TMsgKefuPriority record); + + int insertSelective(TMsgKefuPriority record); + + TMsgKefuPriority selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TMsgKefuPriority record); + + int updateByPrimaryKey(TMsgKefuPriority record); + + List selectByMsgTypeAndMsgName(@Param("msgType") int msgType, @Param("msgName") String msgName); + + int updateByMsgTypeAndMsgName(TMsgKefuPriority tMsgKefuPriority); + + List selectByMsgType(int msgType); + + int deleteByMsgTypeAndName(@Param("msgType") int msgType, @Param("msgName") String msgName); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/dao/TMsgMaTemplateMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TMsgMaTemplateMapper.java new file mode 100644 index 00000000..0088699d --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TMsgMaTemplateMapper.java @@ -0,0 +1,28 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TMsgMaTemplate; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TMsgMaTemplateMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TMsgMaTemplate record); + + int insertSelective(TMsgMaTemplate record); + + TMsgMaTemplate selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TMsgMaTemplate record); + + int updateByPrimaryKey(TMsgMaTemplate record); + + List selectByMsgTypeAndMsgName(@Param("msgType") int msgType, @Param("msgName") String msgName); + + int updateByMsgTypeAndMsgName(TMsgMaTemplate tMsgMaTemplate); + + List selectByMsgType(int msgType); + + int deleteByMsgTypeAndName(@Param("msgType") int msgType, @Param("msgName") String msgName); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/dao/TMsgMpTemplateMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TMsgMpTemplateMapper.java new file mode 100644 index 00000000..c26851cb --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TMsgMpTemplateMapper.java @@ -0,0 +1,28 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TMsgMpTemplate; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TMsgMpTemplateMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TMsgMpTemplate record); + + int insertSelective(TMsgMpTemplate record); + + TMsgMpTemplate selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TMsgMpTemplate record); + + int updateByPrimaryKey(TMsgMpTemplate record); + + List selectByMsgTypeAndMsgName(@Param("msgType") int msgType, @Param("msgName") String msgName); + + int updateByMsgTypeAndMsgName(TMsgMpTemplate tMsgMpTemplate); + + List selectByMsgType(int msgType); + + int deleteByMsgTypeAndName(@Param("msgType") int msgType, @Param("msgName") String msgName); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/dao/TMsgSmsMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TMsgSmsMapper.java new file mode 100644 index 00000000..f7af356e --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TMsgSmsMapper.java @@ -0,0 +1,28 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TMsgSms; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TMsgSmsMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TMsgSms record); + + int insertSelective(TMsgSms record); + + TMsgSms selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TMsgSms record); + + int updateByPrimaryKey(TMsgSms record); + + List selectByMsgTypeAndMsgName(@Param("msgType") int msgType, @Param("msgName") String msgName); + + int updateByMsgTypeAndMsgName(TMsgSms tMsgSms); + + List selectByMsgType(int msgType); + + int deleteByMsgTypeAndName(@Param("msgType") int msgType, @Param("msgName") String msgName); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/dao/TPushHistoryMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TPushHistoryMapper.java new file mode 100644 index 00000000..09f0b222 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TPushHistoryMapper.java @@ -0,0 +1,21 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TPushHistory; + +import java.util.List; + +public interface TPushHistoryMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TPushHistory record); + + int insertSelective(TPushHistory record); + + TPushHistory selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TPushHistory record); + + int updateByPrimaryKey(TPushHistory record); + + List selectByMsgType(int msgType); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/dao/TTemplateDataMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TTemplateDataMapper.java new file mode 100644 index 00000000..f8057e2b --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TTemplateDataMapper.java @@ -0,0 +1,24 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TTemplateData; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TTemplateDataMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TTemplateData record); + + int insertSelective(TTemplateData record); + + TTemplateData selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TTemplateData record); + + int updateByPrimaryKey(TTemplateData record); + + List selectByMsgTypeAndMsgId(@Param("msgType") int msgType, @Param("msgId") int msgId); + + int deleteByMsgTypeAndMsgId(@Param("msgType") int msgType, @Param("msgId") int msgId); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/dao/TWxMpUserMapper.java b/src/main/java/com/fangxuele/tool/push/dao/TWxMpUserMapper.java new file mode 100644 index 00000000..381239a9 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/dao/TWxMpUserMapper.java @@ -0,0 +1,19 @@ +package com.fangxuele.tool.push.dao; + +import com.fangxuele.tool.push.domain.TWxMpUser; + +public interface TWxMpUserMapper { + int deleteByPrimaryKey(String openId); + + int insert(TWxMpUser record); + + int insertSelective(TWxMpUser record); + + TWxMpUser selectByPrimaryKey(String openId); + + int updateByPrimaryKeySelective(TWxMpUser record); + + int updateByPrimaryKey(TWxMpUser record); + + int deleteAll(); +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TMsgKefu.java b/src/main/java/com/fangxuele/tool/push/domain/TMsgKefu.java new file mode 100644 index 00000000..cdc246e3 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TMsgKefu.java @@ -0,0 +1,117 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TMsgKefu implements Serializable { + private Integer id; + + private Integer msgType; + + private String msgName; + + private String kefuMsgType; + + private String content; + + private String title; + + private String imgUrl; + + private String describe; + + private String url; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMsgType() { + return msgType; + } + + public void setMsgType(Integer msgType) { + this.msgType = msgType; + } + + public String getMsgName() { + return msgName; + } + + public void setMsgName(String msgName) { + this.msgName = msgName == null ? null : msgName.trim(); + } + + public String getKefuMsgType() { + return kefuMsgType; + } + + public void setKefuMsgType(String kefuMsgType) { + this.kefuMsgType = kefuMsgType == null ? null : kefuMsgType.trim(); + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title == null ? null : title.trim(); + } + + public String getImgUrl() { + return imgUrl; + } + + public void setImgUrl(String imgUrl) { + this.imgUrl = imgUrl == null ? null : imgUrl.trim(); + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe == null ? null : describe.trim(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TMsgKefuPriority.java b/src/main/java/com/fangxuele/tool/push/domain/TMsgKefuPriority.java new file mode 100644 index 00000000..fa3c90a6 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TMsgKefuPriority.java @@ -0,0 +1,157 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TMsgKefuPriority implements Serializable { + private Integer id; + + private Integer msgType; + + private String msgName; + + private String templateId; + + private String url; + + private String maAppid; + + private String maPagePath; + + private String kefuMsgType; + + private String content; + + private String title; + + private String imgUrl; + + private String describe; + + private String kefuUrl; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMsgType() { + return msgType; + } + + public void setMsgType(Integer msgType) { + this.msgType = msgType; + } + + public String getMsgName() { + return msgName; + } + + public void setMsgName(String msgName) { + this.msgName = msgName == null ? null : msgName.trim(); + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId == null ? null : templateId.trim(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + public String getMaAppid() { + return maAppid; + } + + public void setMaAppid(String maAppid) { + this.maAppid = maAppid == null ? null : maAppid.trim(); + } + + public String getMaPagePath() { + return maPagePath; + } + + public void setMaPagePath(String maPagePath) { + this.maPagePath = maPagePath == null ? null : maPagePath.trim(); + } + + public String getKefuMsgType() { + return kefuMsgType; + } + + public void setKefuMsgType(String kefuMsgType) { + this.kefuMsgType = kefuMsgType == null ? null : kefuMsgType.trim(); + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title == null ? null : title.trim(); + } + + public String getImgUrl() { + return imgUrl; + } + + public void setImgUrl(String imgUrl) { + this.imgUrl = imgUrl == null ? null : imgUrl.trim(); + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe == null ? null : describe.trim(); + } + + public String getKefuUrl() { + return kefuUrl; + } + + public void setKefuUrl(String kefuUrl) { + this.kefuUrl = kefuUrl == null ? null : kefuUrl.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TMsgMaTemplate.java b/src/main/java/com/fangxuele/tool/push/domain/TMsgMaTemplate.java new file mode 100644 index 00000000..3914f85d --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TMsgMaTemplate.java @@ -0,0 +1,87 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TMsgMaTemplate implements Serializable { + private Integer id; + + private Integer msgType; + + private String msgName; + + private String templateId; + + private String page; + + private String emphasisKeyword; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMsgType() { + return msgType; + } + + public void setMsgType(Integer msgType) { + this.msgType = msgType; + } + + public String getMsgName() { + return msgName; + } + + public void setMsgName(String msgName) { + this.msgName = msgName == null ? null : msgName.trim(); + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId == null ? null : templateId.trim(); + } + + public String getPage() { + return page; + } + + public void setPage(String page) { + this.page = page == null ? null : page.trim(); + } + + public String getEmphasisKeyword() { + return emphasisKeyword; + } + + public void setEmphasisKeyword(String emphasisKeyword) { + this.emphasisKeyword = emphasisKeyword == null ? null : emphasisKeyword.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TMsgMpTemplate.java b/src/main/java/com/fangxuele/tool/push/domain/TMsgMpTemplate.java new file mode 100644 index 00000000..c981b0fa --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TMsgMpTemplate.java @@ -0,0 +1,97 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TMsgMpTemplate implements Serializable { + private Integer id; + + private Integer msgType; + + private String msgName; + + private String templateId; + + private String url; + + private String maAppid; + + private String maPagePath; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMsgType() { + return msgType; + } + + public void setMsgType(Integer msgType) { + this.msgType = msgType; + } + + public String getMsgName() { + return msgName; + } + + public void setMsgName(String msgName) { + this.msgName = msgName == null ? null : msgName.trim(); + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId == null ? null : templateId.trim(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + public String getMaAppid() { + return maAppid; + } + + public void setMaAppid(String maAppid) { + this.maAppid = maAppid == null ? null : maAppid.trim(); + } + + public String getMaPagePath() { + return maPagePath; + } + + public void setMaPagePath(String maPagePath) { + this.maPagePath = maPagePath == null ? null : maPagePath.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TMsgSms.java b/src/main/java/com/fangxuele/tool/push/domain/TMsgSms.java new file mode 100644 index 00000000..f6c9745d --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TMsgSms.java @@ -0,0 +1,77 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TMsgSms implements Serializable { + private Integer id; + + private Integer msgType; + + private String msgName; + + private String templateId; + + private String content; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMsgType() { + return msgType; + } + + public void setMsgType(Integer msgType) { + this.msgType = msgType; + } + + public String getMsgName() { + return msgName; + } + + public void setMsgName(String msgName) { + this.msgName = msgName == null ? null : msgName.trim(); + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId == null ? null : templateId.trim(); + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TPushHistory.java b/src/main/java/com/fangxuele/tool/push/domain/TPushHistory.java new file mode 100644 index 00000000..ef6d17a0 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TPushHistory.java @@ -0,0 +1,87 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TPushHistory implements Serializable { + private Integer id; + + private Integer msgId; + + private Integer msgType; + + private String msgName; + + private String result; + + private String csvFile; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMsgId() { + return msgId; + } + + public void setMsgId(Integer msgId) { + this.msgId = msgId; + } + + public Integer getMsgType() { + return msgType; + } + + public void setMsgType(Integer msgType) { + this.msgType = msgType; + } + + public String getMsgName() { + return msgName; + } + + public void setMsgName(String msgName) { + this.msgName = msgName == null ? null : msgName.trim(); + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result == null ? null : result.trim(); + } + + public String getCsvFile() { + return csvFile; + } + + public void setCsvFile(String csvFile) { + this.csvFile = csvFile == null ? null : csvFile.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TTemplateData.java b/src/main/java/com/fangxuele/tool/push/domain/TTemplateData.java new file mode 100644 index 00000000..fd07a7d0 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TTemplateData.java @@ -0,0 +1,87 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TTemplateData implements Serializable { + private Integer id; + + private Integer msgType; + + private Integer msgId; + + private String name; + + private String value; + + private String color; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getMsgType() { + return msgType; + } + + public void setMsgType(Integer msgType) { + this.msgType = msgType; + } + + public Integer getMsgId() { + return msgId; + } + + public void setMsgId(Integer msgId) { + this.msgId = msgId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value == null ? null : value.trim(); + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color == null ? null : color.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/domain/TWxMpUser.java b/src/main/java/com/fangxuele/tool/push/domain/TWxMpUser.java new file mode 100644 index 00000000..5b63d772 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/domain/TWxMpUser.java @@ -0,0 +1,187 @@ +package com.fangxuele.tool.push.domain; + +import java.io.Serializable; + +public class TWxMpUser implements Serializable { + private String openId; + + private String nickname; + + private String sexDesc; + + private Integer sex; + + private String language; + + private String city; + + private String province; + + private String country; + + private String headImgUrl; + + private String subscribeTime; + + private String unionId; + + private String remark; + + private Integer groupId; + + private String subscribeScene; + + private String qrScene; + + private String qrSceneStr; + + private String createTime; + + private String modifiedTime; + + private static final long serialVersionUID = 1L; + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId == null ? null : openId.trim(); + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname == null ? null : nickname.trim(); + } + + public String getSexDesc() { + return sexDesc; + } + + public void setSexDesc(String sexDesc) { + this.sexDesc = sexDesc == null ? null : sexDesc.trim(); + } + + public Integer getSex() { + return sex; + } + + public void setSex(Integer sex) { + this.sex = sex; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language == null ? null : language.trim(); + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city == null ? null : city.trim(); + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province == null ? null : province.trim(); + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country == null ? null : country.trim(); + } + + public String getHeadImgUrl() { + return headImgUrl; + } + + public void setHeadImgUrl(String headImgUrl) { + this.headImgUrl = headImgUrl == null ? null : headImgUrl.trim(); + } + + public String getSubscribeTime() { + return subscribeTime; + } + + public void setSubscribeTime(String subscribeTime) { + this.subscribeTime = subscribeTime == null ? null : subscribeTime.trim(); + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId == null ? null : unionId.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Integer getGroupId() { + return groupId; + } + + public void setGroupId(Integer groupId) { + this.groupId = groupId; + } + + public String getSubscribeScene() { + return subscribeScene; + } + + public void setSubscribeScene(String subscribeScene) { + this.subscribeScene = subscribeScene == null ? null : subscribeScene.trim(); + } + + public String getQrScene() { + return qrScene; + } + + public void setQrScene(String qrScene) { + this.qrScene = qrScene == null ? null : qrScene.trim(); + } + + public String getQrSceneStr() { + return qrSceneStr; + } + + public void setQrSceneStr(String qrSceneStr) { + this.qrSceneStr = qrSceneStr == null ? null : qrSceneStr.trim(); + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime == null ? null : createTime.trim(); + } + + public String getModifiedTime() { + return modifiedTime; + } + + public void setModifiedTime(String modifiedTime) { + this.modifiedTime = modifiedTime == null ? null : modifiedTime.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/logic/AliDayuTemplateSmsMsgServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/AliDayuTemplateSmsMsgServiceThread.java index 83a24ba9..2a2d2259 100644 --- a/src/main/java/com/fangxuele/tool/push/logic/AliDayuTemplateSmsMsgServiceThread.java +++ b/src/main/java/com/fangxuele/tool/push/logic/AliDayuTemplateSmsMsgServiceThread.java @@ -1,14 +1,11 @@ package com.fangxuele.tool.push.logic; import com.fangxuele.tool.push.ui.Init; -import com.fangxuele.tool.push.ui.form.MainWindow; +import com.fangxuele.tool.push.ui.form.PushForm; import com.taobao.api.DefaultTaobaoClient; import com.taobao.api.TaobaoClient; import com.taobao.api.request.AlibabaAliqinFcSmsNumSendRequest; import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse; -import org.apache.commons.lang3.StringUtils; - -import javax.swing.*; /** *
@@ -23,12 +20,11 @@ public class AliDayuTemplateSmsMsgServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param startIndex 起始索引
+     * @param endIndex   截止索引
      */
-    public AliDayuTemplateSmsMsgServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    public AliDayuTemplateSmsMsgServiceThread(int startIndex, int endIndex) {
+        super(startIndex, endIndex);
     }
 
     @Override
@@ -37,16 +33,9 @@ public void run() {
         // 初始化当前线程
         initCurrentThread();
 
-        String aliServerUrl = Init.configer.getAliServerUrl();
-        String aliAppKey = Init.configer.getAliAppKey();
-        String aliAppSecret = Init.configer.getAliAppSecret();
-
-        if (StringUtils.isEmpty(aliServerUrl) || StringUtils.isEmpty(aliAppKey)
-                || StringUtils.isEmpty(aliAppSecret)) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
-                    "请先在设置中填写并保存阿里大于相关配置!", "提示",
-                    JOptionPane.INFORMATION_MESSAGE);
-        }
+        String aliServerUrl = Init.config.getAliServerUrl();
+        String aliAppKey = Init.config.getAliAppKey();
+        String aliAppSecret = Init.config.getAliAppSecret();
 
         TaobaoClient client = new DefaultTaobaoClient(aliServerUrl, aliAppKey, aliAppSecret);
 
@@ -70,12 +59,12 @@ public void run() {
                 alibabaAliqinFcSmsNumSendRequest.setRecNum(telNum);
 
                 // 空跑控制
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     response = client.execute(alibabaAliqinFcSmsNumSendRequest);
                     if (response.getResult() != null && response.getResult().getSuccess()) {
                         // 总发送成功+1
                         PushData.increaseSuccess();
-                        MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                        PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                         // 当前线程发送成功+1
                         currentThreadSuccessCount++;
@@ -86,7 +75,7 @@ public void run() {
                     } else {
                         // 总发送失败+1
                         PushData.increaseFail();
-                        MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                        PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                         // 保存发送失败
                         PushData.sendFailList.add(msgData);
@@ -102,7 +91,7 @@ public void run() {
                 } else {
                     // 总发送成功+1
                     PushData.increaseSuccess();
-                    MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                    PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                     // 当前线程发送成功+1
                     currentThreadSuccessCount++;
@@ -115,7 +104,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -131,7 +120,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/logic/AliYunSmsMsgServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/AliYunSmsMsgServiceThread.java
index 55962ebb..faf98a5d 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/AliYunSmsMsgServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/AliYunSmsMsgServiceThread.java
@@ -7,10 +7,7 @@
 import com.aliyuncs.profile.DefaultProfile;
 import com.aliyuncs.profile.IClientProfile;
 import com.fangxuele.tool.push.ui.Init;
-import com.fangxuele.tool.push.ui.form.MainWindow;
-import org.apache.commons.lang3.StringUtils;
-
-import javax.swing.*;
+import com.fangxuele.tool.push.ui.form.PushForm;
 
 /**
  * 
@@ -25,12 +22,11 @@ public class AliYunSmsMsgServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param startIndex 起始索引
+     * @param endIndex   截止索引
      */
-    public AliYunSmsMsgServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    public AliYunSmsMsgServiceThread(int startIndex, int endIndex) {
+        super(startIndex, endIndex);
     }
 
     @Override
@@ -39,14 +35,8 @@ public void run() {
         // 初始化当前线程
         initCurrentThread();
 
-        String aliyunAccessKeyId = Init.configer.getAliyunAccessKeyId();
-        String aliyunAccessKeySecret = Init.configer.getAliyunAccessKeySecret();
-
-        if (StringUtils.isEmpty(aliyunAccessKeyId) || StringUtils.isEmpty(aliyunAccessKeySecret)) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
-                    "请先在设置中填写并保存阿里云短信相关配置!", "提示",
-                    JOptionPane.INFORMATION_MESSAGE);
-        }
+        String aliyunAccessKeyId = Init.config.getAliyunAccessKeyId();
+        String aliyunAccessKeySecret = Init.config.getAliyunAccessKeySecret();
 
         //初始化acsClient,暂不支持region化
         IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunAccessKeyId, aliyunAccessKeySecret);
@@ -73,12 +63,12 @@ public void run() {
                 sendSmsRequest.setPhoneNumbers(telNum);
 
                 // 空跑控制
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     response = acsClient.getAcsResponse(sendSmsRequest);
                     if (response.getCode() != null && "OK".equals(response.getCode())) {
                         // 总发送成功+1
                         PushData.increaseSuccess();
-                        MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                        PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                         // 当前线程发送成功+1
                         currentThreadSuccessCount++;
@@ -89,7 +79,7 @@ public void run() {
                     } else {
                         // 总发送失败+1
                         PushData.increaseFail();
-                        MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                        PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                         // 保存发送失败
                         PushData.sendFailList.add(msgData);
@@ -105,7 +95,7 @@ public void run() {
                 } else {
                     // 总发送成功+1
                     PushData.increaseSuccess();
-                    MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                    PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                     // 当前线程发送成功+1
                     currentThreadSuccessCount++;
@@ -118,7 +108,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -134,7 +124,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/logic/BaseMsgServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/BaseMsgServiceThread.java
index a75918af..fc07c1dc 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/BaseMsgServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/BaseMsgServiceThread.java
@@ -2,7 +2,7 @@
 
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.PushForm;
 import me.chanjar.weixin.mp.api.WxMpService;
 
 import javax.swing.table.DefaultTableModel;
@@ -21,14 +21,14 @@ public class BaseMsgServiceThread extends Thread {
     public static final Log logger = LogFactory.get();
 
     /**
-     * 起始页号
+     * 起始索引
      */
-    private int pageFrom;
+    private int startIndex;
 
     /**
-     * 截至页号
+     * 截止索引
      */
-    private int pageTo;
+    private int endIndex;
 
     /**
      * 页大小
@@ -68,14 +68,12 @@ public class BaseMsgServiceThread extends Thread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param start 起始页
+     * @param end   截止页
      */
-    public BaseMsgServiceThread(int pageFrom, int pageTo, int pageSize) {
-        this.pageFrom = pageFrom;
-        this.pageTo = pageTo;
-        this.pageSize = pageSize;
+    public BaseMsgServiceThread(int start, int end) {
+        this.startIndex = start;
+        this.endIndex = end;
     }
 
     @Override
@@ -87,20 +85,13 @@ public void run() {
      * 初始化当前线程
      */
     void initCurrentThread() {
-        PushManage.console("线程" + this.getName() + "负责处理:" + pageFrom + "-" +
-                pageTo + "页的数据");
-
-        int end = pageTo * pageSize + pageSize;
-        if (PushData.totalRecords < end) {
-            end = (int) PushData.totalRecords;
-        }
-
-        int start = pageFrom * pageSize;
+        PushManage.console("线程" + this.getName() + "负责处理:" + startIndex + "-" +
+                endIndex + "的分片数据");
 
-        list = PushData.toSendList.subList(start, end);
+        list = PushData.toSendList.subList(startIndex, endIndex);
 
         // 初始化线程列表行
-        tableModel = (DefaultTableModel) MainWindow.mainWindow.getPushThreadTable().getModel();
+        tableModel = (DefaultTableModel) PushForm.pushForm.getPushThreadTable().getModel();
         currentThreadSuccessCount = 0;
         currentThreadFailCount = 0;
         tableModel.setValueAt(currentThreadSuccessCount, tableRow, 2);
@@ -113,8 +104,8 @@ void initCurrentThread() {
      * 当前线程结束
      */
     void currentThreadFinish() {
-        PushManage.console(this.getName() + "已处理完第" + pageFrom + "-" +
-                pageTo + "页的数据");
+        PushManage.console(this.getName() + "已处理完第" + startIndex + "-" +
+                endIndex + "页的数据");
 
         PushData.increaseStopedThread();
     }
@@ -135,20 +126,20 @@ public void setPageSize(int pageSize) {
         this.pageSize = pageSize;
     }
 
-    public int getPageFrom() {
-        return pageFrom;
+    public int getStartIndex() {
+        return startIndex;
     }
 
-    public void setPageFrom(int pageFrom) {
-        this.pageFrom = pageFrom;
+    public void setStartIndex(int startIndex) {
+        this.startIndex = startIndex;
     }
 
-    public int getPageTo() {
-        return pageTo;
+    public int getEndIndex() {
+        return endIndex;
     }
 
-    public void setPageTo(int pageTo) {
-        this.pageTo = pageTo;
+    public void setEndIndex(int endIndex) {
+        this.endIndex = endIndex;
     }
 
     public int getTableRow() {
diff --git a/src/main/java/com/fangxuele/tool/push/logic/KeFuMsgServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/KeFuMsgServiceThread.java
index a007220b..8a349773 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/KeFuMsgServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/KeFuMsgServiceThread.java
@@ -1,6 +1,6 @@
 package com.fangxuele.tool.push.logic;
 
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.PushForm;
 import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
 
 /**
@@ -16,12 +16,11 @@ public class KeFuMsgServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param pageFrom 开始索引
+     * @param pageTo   截止索引
      */
-    KeFuMsgServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    KeFuMsgServiceThread(int pageFrom, int pageTo) {
+        super(pageFrom, pageTo);
     }
 
     @Override
@@ -47,13 +46,13 @@ public void run() {
                 wxMpKefuMessage = MessageMaker.makeKefuMessage(msgData);
                 wxMpKefuMessage.setToUser(openId);
                 // 空跑控制
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     wxMpService.getKefuService().sendKefuMessage(wxMpKefuMessage);
                 }
 
                 // 总发送成功+1
                 PushData.increaseSuccess();
-                MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                 // 当前线程发送成功+1
                 currentThreadSuccessCount++;
@@ -64,7 +63,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -80,7 +79,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/logic/KeFuPriorMsgServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/KeFuPriorMsgServiceThread.java
index 59f2f95e..24c89f16 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/KeFuPriorMsgServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/KeFuPriorMsgServiceThread.java
@@ -1,6 +1,6 @@
 package com.fangxuele.tool.push.logic;
 
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.PushForm;
 import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
 import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
 
@@ -17,12 +17,11 @@ public class KeFuPriorMsgServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param pageFrom 起始索引
+     * @param pageTo   截止索引
      */
-    public KeFuPriorMsgServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    public KeFuPriorMsgServiceThread(int pageFrom, int pageTo) {
+        super(pageFrom, pageTo);
     }
 
     @Override
@@ -52,18 +51,18 @@ public void run() {
                 wxMpKefuMessage.setToUser(openId);
                 wxMpTemplateMessage.setToUser(openId);
                 try {// 空跑控制
-                    if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                    if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                         wxMpService.getKefuService().sendKefuMessage(wxMpKefuMessage);
                     }
                 } catch (Exception e) {
-                    if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                    if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                         wxMpService.getTemplateMsgService().sendTemplateMsg(wxMpTemplateMessage);
                     }
                 }
 
                 // 总发送成功+1
                 PushData.increaseSuccess();
-                MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                 // 当前线程发送成功+1
                 currentThreadSuccessCount++;
@@ -74,7 +73,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -90,7 +89,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/logic/MessageMaker.java b/src/main/java/com/fangxuele/tool/push/logic/MessageMaker.java
index 843e9304..005ab539 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/MessageMaker.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/MessageMaker.java
@@ -6,7 +6,7 @@
 import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
 import com.aliyuncs.http.MethodType;
 import com.fangxuele.tool.push.ui.Init;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.MessageEditForm;
 import com.fangxuele.tool.push.util.TemplateUtil;
 import com.taobao.api.request.AlibabaAliqinFcSmsNumSendRequest;
 import com.yunpian.sdk.YunpianClient;
@@ -38,11 +38,11 @@ public class MessageMaker {
     synchronized static WxMpTemplateMessage makeMpTemplateMessage(String[] msgData) {
         // 拼模板
         WxMpTemplateMessage wxMessageTemplate = WxMpTemplateMessage.builder().build();
-        wxMessageTemplate.setTemplateId(MainWindow.mainWindow.getMsgTemplateIdTextField().getText().trim());
-        wxMessageTemplate.setUrl(MainWindow.mainWindow.getMsgTemplateUrlTextField().getText().trim());
+        wxMessageTemplate.setTemplateId(MessageEditForm.messageEditForm.getMsgTemplateIdTextField().getText().trim());
+        wxMessageTemplate.setUrl(MessageEditForm.messageEditForm.getMsgTemplateUrlTextField().getText().trim());
 
-        String appid = MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().getText().trim();
-        String pagePath = MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().getText().trim();
+        String appid = MessageEditForm.messageEditForm.getMsgTemplateMiniAppidTextField().getText().trim();
+        String pagePath = MessageEditForm.messageEditForm.getMsgTemplateMiniPagePathTextField().getText().trim();
 
         VelocityContext velocityContext = new VelocityContext();
         for (int i = 0; i < msgData.length; i++) {
@@ -52,11 +52,11 @@ synchronized static WxMpTemplateMessage makeMpTemplateMessage(String[] msgData)
         WxMpTemplateMessage.MiniProgram miniProgram = new WxMpTemplateMessage.MiniProgram(appid, pagePath, true);
         wxMessageTemplate.setMiniProgram(miniProgram);
 
-        if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
-            Init.initTemplateDataTable();
+        if (MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
+            MessageEditForm.initTemplateDataTable();
         }
 
-        DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable().getModel();
+        DefaultTableModel tableModel = (DefaultTableModel) MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel();
         int rowCount = tableModel.getRowCount();
         for (int i = 0; i < rowCount; i++) {
             String name = ((String) tableModel.getValueAt(i, 0)).trim();
@@ -81,15 +81,15 @@ synchronized static WxMpTemplateMessage makeMpTemplateMessage(String[] msgData)
     synchronized static WxMaTemplateMessage makeMaTemplateMessage(String[] msgData) {
         // 拼模板
         WxMaTemplateMessage wxMessageTemplate = WxMaTemplateMessage.builder().build();
-        wxMessageTemplate.setTemplateId(MainWindow.mainWindow.getMsgTemplateIdTextField().getText().trim());
-        wxMessageTemplate.setPage(MainWindow.mainWindow.getMsgTemplateUrlTextField().getText().trim());
-        wxMessageTemplate.setEmphasisKeyword(MainWindow.mainWindow.getMsgTemplateKeyWordTextField().getText().trim() + ".DATA");
+        wxMessageTemplate.setTemplateId(MessageEditForm.messageEditForm.getMsgTemplateIdTextField().getText().trim());
+        wxMessageTemplate.setPage(MessageEditForm.messageEditForm.getMsgTemplateUrlTextField().getText().trim());
+        wxMessageTemplate.setEmphasisKeyword(MessageEditForm.messageEditForm.getMsgTemplateKeyWordTextField().getText().trim() + ".DATA");
 
-        if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
-            Init.initTemplateDataTable();
+        if (MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
+            MessageEditForm.initTemplateDataTable();
         }
 
-        DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable().getModel();
+        DefaultTableModel tableModel = (DefaultTableModel) MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel();
         int rowCount = tableModel.getRowCount();
 
         VelocityContext velocityContext = new VelocityContext();
@@ -123,28 +123,28 @@ synchronized static WxMpKefuMessage makeKefuMessage(String[] msgData) {
         for (int i = 0; i < msgData.length; i++) {
             velocityContext.put(PushManage.TEMPLATE_VAR_PREFIX + i, msgData[i]);
         }
-        if ("图文消息".equals(Objects.requireNonNull(MainWindow.mainWindow.getMsgKefuMsgTypeComboBox().getSelectedItem()).toString())) {
+        if ("图文消息".equals(Objects.requireNonNull(MessageEditForm.messageEditForm.getMsgKefuMsgTypeComboBox().getSelectedItem()).toString())) {
             WxMpKefuMessage.WxArticle article = new WxMpKefuMessage.WxArticle();
 
             // 标题
-            String title = MainWindow.mainWindow.getMsgKefuMsgTitleTextField().getText();
+            String title = MessageEditForm.messageEditForm.getMsgKefuMsgTitleTextField().getText();
             title = TemplateUtil.evaluate(title, velocityContext);
             article.setTitle(title);
 
             // 图片url
-            article.setPicUrl(MainWindow.mainWindow.getMsgKefuPicUrlTextField().getText());
+            article.setPicUrl(MessageEditForm.messageEditForm.getMsgKefuPicUrlTextField().getText());
 
             // 描述
-            String description = MainWindow.mainWindow.getMsgKefuDescTextField().getText();
+            String description = MessageEditForm.messageEditForm.getMsgKefuDescTextField().getText();
             description = TemplateUtil.evaluate(description, velocityContext);
             article.setDescription(description);
 
             // 跳转url
-            article.setUrl(MainWindow.mainWindow.getMsgKefuUrlTextField().getText());
+            article.setUrl(MessageEditForm.messageEditForm.getMsgKefuUrlTextField().getText());
 
             kefuMessage = WxMpKefuMessage.NEWS().addArticle(article).build();
-        } else if ("文本消息".equals(MainWindow.mainWindow.getMsgKefuMsgTypeComboBox().getSelectedItem().toString())) {
-            String content = MainWindow.mainWindow.getMsgKefuMsgTitleTextField().getText();
+        } else if ("文本消息".equals(MessageEditForm.messageEditForm.getMsgKefuMsgTypeComboBox().getSelectedItem().toString())) {
+            String content = MessageEditForm.messageEditForm.getMsgKefuMsgTitleTextField().getText();
             content = TemplateUtil.evaluate(content, velocityContext);
             kefuMessage = WxMpKefuMessage.TEXT().content(content).build();
         }
@@ -163,16 +163,16 @@ synchronized static SendSmsRequest makeAliyunMessage(String[] msgData) {
         //使用post提交
         request.setMethod(MethodType.POST);
         //必填:短信签名-可在短信控制台中找到
-        request.setSignName(Init.configer.getAliyunSign());
+        request.setSignName(Init.config.getAliyunSign());
 
         // 模板参数
         Map paramMap = new HashMap();
 
-        if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
-            Init.initTemplateDataTable();
+        if (MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
+            MessageEditForm.initTemplateDataTable();
         }
 
-        DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable().getModel();
+        DefaultTableModel tableModel = (DefaultTableModel) MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel();
         int rowCount = tableModel.getRowCount();
 
         VelocityContext velocityContext = new VelocityContext();
@@ -190,7 +190,7 @@ synchronized static SendSmsRequest makeAliyunMessage(String[] msgData) {
         request.setTemplateParam(JSONUtil.parseFromMap(paramMap).toJSONString(0));
 
         // 短信模板ID,传入的模板必须是在阿里阿里云短信中的可用模板。示例:SMS_585014
-        request.setTemplateCode(MainWindow.mainWindow.getMsgTemplateIdTextField().getText());
+        request.setTemplateCode(MessageEditForm.messageEditForm.getMsgTemplateIdTextField().getText());
 
         return request;
     }
@@ -211,11 +211,11 @@ synchronized static AlibabaAliqinFcSmsNumSendRequest makeAliTemplateMessage(Stri
         // 模板参数
         Map paramMap = new HashMap();
 
-        if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
-            Init.initTemplateDataTable();
+        if (MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
+            MessageEditForm.initTemplateDataTable();
         }
 
-        DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable().getModel();
+        DefaultTableModel tableModel = (DefaultTableModel) MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel();
         int rowCount = tableModel.getRowCount();
         VelocityContext velocityContext = new VelocityContext();
         for (int i = 0; i < msgData.length; i++) {
@@ -233,9 +233,9 @@ synchronized static AlibabaAliqinFcSmsNumSendRequest makeAliTemplateMessage(Stri
 
         // 短信签名,传入的短信签名必须是在阿里大鱼“管理中心-短信签名管理”中的可用签名。如“阿里大鱼”已在短信签名管理中通过审核,
         // 则可传入”阿里大鱼“(传参时去掉引号)作为短信签名。短信效果示例:【阿里大鱼】欢迎使用阿里大鱼服务。
-        request.setSmsFreeSignName(Init.configer.getAliSign());
+        request.setSmsFreeSignName(Init.config.getAliSign());
         // 短信模板ID,传入的模板必须是在阿里大鱼“管理中心-短信模板管理”中的可用模板。示例:SMS_585014
-        request.setSmsTemplateCode(MainWindow.mainWindow.getMsgTemplateIdTextField().getText());
+        request.setSmsTemplateCode(MessageEditForm.messageEditForm.getMsgTemplateIdTextField().getText());
 
         return request;
     }
@@ -247,11 +247,11 @@ synchronized static AlibabaAliqinFcSmsNumSendRequest makeAliTemplateMessage(Stri
      * @return String[]
      */
     synchronized static String[] makeTxyunMessage(String[] msgData) {
-        if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
-            Init.initTemplateDataTable();
+        if (MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel().getRowCount() == 0) {
+            MessageEditForm.initTemplateDataTable();
         }
 
-        DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable().getModel();
+        DefaultTableModel tableModel = (DefaultTableModel) MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel();
         int rowCount = tableModel.getRowCount();
         String[] params = new String[rowCount];
 
@@ -283,7 +283,7 @@ synchronized static Map makeYunpianMessage(String[] msgData) {
             velocityContext.put(PushManage.TEMPLATE_VAR_PREFIX + i, msgData[i]);
         }
 
-        String text = MainWindow.mainWindow.getMsgYunpianMsgContentTextField().getText();
+        String text = MessageEditForm.messageEditForm.getMsgYunpianMsgContentTextField().getText();
         text = TemplateUtil.evaluate(text, velocityContext);
 
         params.put(YunpianClient.TEXT, text);
diff --git a/src/main/java/com/fangxuele/tool/push/logic/MessageTypeConsts.java b/src/main/java/com/fangxuele/tool/push/logic/MessageTypeConsts.java
deleted file mode 100644
index 2a0a0ae2..00000000
--- a/src/main/java/com/fangxuele/tool/push/logic/MessageTypeConsts.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.fangxuele.tool.push.logic;
-
-/**
- * 
- * 消息类型常量
- * 
- * - * @author Zhou Bo - * @since 2019/3/26. - */ -public interface MessageTypeConsts { - String MP_TEMPLATE = "模板消息"; - String MA_TEMPLATE = "模板消息-小程序"; - String KEFU = "客服消息"; - String KEFU_PRIORITY = "客服消息优先"; - String ALI_TEMPLATE = "阿里大于模板短信"; - String ALI_YUN = "阿里云短信"; - String TX_YUN = "腾讯云短信"; - String YUN_PIAN = "云片网短信"; -} diff --git a/src/main/java/com/fangxuele/tool/push/logic/MessageTypeEnum.java b/src/main/java/com/fangxuele/tool/push/logic/MessageTypeEnum.java new file mode 100644 index 00000000..e7829f3d --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/logic/MessageTypeEnum.java @@ -0,0 +1,88 @@ +package com.fangxuele.tool.push.logic; + +/** + *
+ * 消息类型常量
+ * 
+ * + * @author Zhou Bo + * @since 2019/3/26. + */ +public enum MessageTypeEnum { + /** + * 消息类型 + */ + MP_TEMPLATE(1, "公众号-模板消息"), + MA_TEMPLATE(2, "小程序-模板消息"), + KEFU(3, "公众号-客服消息"), + KEFU_PRIORITY(4, "公众号-客服消息优先"), + ALI_YUN(5, "阿里云短信"), + ALI_TEMPLATE(6, "阿里大于模板短信"), + TX_YUN(7, "腾讯云短信"), + YUN_PIAN(8, "云片网短信"), + UP_YUN(9, "又拍云短信"), + HW_YUN(10, "华为云短信"), + EMAIL(11, "E-Mail"); + + private int code; + + private String name; + + public static final int MP_TEMPLATE_CODE = 1; + public static final int MA_TEMPLATE_CODE = 2; + public static final int KEFU_CODE = 3; + public static final int KEFU_PRIORITY_CODE = 4; + public static final int ALI_YUN_CODE = 5; + public static final int ALI_TEMPLATE_CODE = 6; + public static final int TX_YUN_CODE = 7; + public static final int YUN_PIAN_CODE = 8; + public static final int UP_YUN_CODE = 9; + public static final int HW_YUN_CODE = 10; + public static final int EMAIL_CODE = 11; + + MessageTypeEnum(int code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(int code) { + String name = ""; + switch (code) { + case 1: + name = MP_TEMPLATE.name; + break; + case 2: + name = MA_TEMPLATE.name; + break; + case 3: + name = KEFU.name; + break; + case 4: + name = KEFU_PRIORITY.name; + break; + case 5: + name = ALI_YUN.name; + break; + case 6: + name = ALI_TEMPLATE.name; + break; + case 7: + name = TX_YUN.name; + break; + case 8: + name = YUN_PIAN.name; + break; + case 9: + name = UP_YUN.name; + break; + case 10: + name = HW_YUN.name; + break; + case 11: + name = EMAIL.name; + break; + default: + } + return name; + } +} diff --git a/src/main/java/com/fangxuele/tool/push/logic/MsgHisManage.java b/src/main/java/com/fangxuele/tool/push/logic/MsgHisManage.java deleted file mode 100644 index aec252a4..00000000 --- a/src/main/java/com/fangxuele/tool/push/logic/MsgHisManage.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.fangxuele.tool.push.logic; - -import cn.hutool.log.Log; -import cn.hutool.log.LogFactory; -import com.fangxuele.tool.push.ui.Init; -import com.fangxuele.tool.push.ui.form.MainWindow; -import com.fangxuele.tool.push.util.SystemUtil; -import com.opencsv.CSVReader; -import com.opencsv.CSVWriter; - -import javax.swing.table.DefaultTableModel; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - *
- * 历史消息管理(单例)
- * 
- * - * @author RememBerBer - * @since 2017/6/17. - */ -public class MsgHisManage { - private static final Log logger = LogFactory.get(); - - private static MsgHisManage ourInstance = new MsgHisManage(); - - private File msgHisFile; - - /** - * 历史消息保存的csv的列数 - */ - public static final int ARRAY_LENGTH = 15; - - public static MsgHisManage getInstance() { - return ourInstance; - } - - private MsgHisManage() { - try { - msgHisFile = new File(SystemUtil.configHome + "data" + File.separator + "msg_his.csv"); - File msgHisDir = new File(SystemUtil.configHome + "data" + File.separator); - if (!msgHisFile.exists()) { - msgHisDir.mkdirs(); - msgHisFile.createNewFile(); - CSVWriter writer = new CSVWriter(new FileWriter(msgHisFile)); - String[] entries = new String[]{"消息名称", "消息类型", "模板ID", "跳转URL", "客服消息类型", "客服消息标题/内容", "客服消息图片URL", "客服消息描述", "客服消息跳转URL"}; - writer.writeNext(entries); - writer.close(); - } - } catch (IOException e) { - e.printStackTrace(); - logger.error(e); - } - } - - /** - * 读取历史消息 - * - * @return key:消息名称 value:消息详情 - */ - public Map readMsgHis() { - Map map = new LinkedHashMap<>(); - CSVReader reader = null; - try { - reader = new CSVReader(new FileReader(msgHisFile)); - - String[] nextLine; - reader.readNext();// 第一行header - while ((nextLine = reader.readNext()) != null) { - map.put(nextLine[0], nextLine); - } - } catch (IOException e) { - e.printStackTrace(); - logger.error(e); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - e.printStackTrace(); - logger.error(e); - } - } - } - return map; - } - - /** - * (根据消息名称)读取模板数据 - * - * @param msgName 消息名称 - * @return {name,value,color} - */ - public List readTemplateData(String msgName) { - CSVReader reader = null; - List list = new ArrayList<>(); - File dir = new File(SystemUtil.configHome + "data" + File.separator + "template_data" + File.separator); - File file = new File(SystemUtil.configHome + "data" + File.separator + "template_data" + File.separator + msgName + ".csv"); - try { - if (!file.exists()) { - dir.mkdirs(); - file.createNewFile(); - } - reader = new CSVReader(new FileReader(file)); - list = reader.readAll(); - } catch (IOException e) { - e.printStackTrace(); - logger.error(e); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - e.printStackTrace(); - logger.error(e); - } - } - } - return list; - } - - /** - * 写入(保存)消息历史 - * - * @param map key:消息名称 value:消息详情 - * @throws IOException io异常 - */ - public void writeMsgHis(Map map) throws IOException { - CSVWriter writer = new CSVWriter(new FileWriter(msgHisFile)); - String[] entries = new String[]{"消息名称", "消息类型", "模板ID", "跳转URL", "客服消息类型", "客服消息标题/内容", "客服消息图片URL", "客服消息描述", "客服消息跳转URL"}; - writer.writeNext(entries); - writer.writeAll(map.values()); - writer.close(); - } - - /** - * 保持模板数据 - * - * @param msgName 消息名称 - * @throws IOException - */ - public void writeTemplateData(String msgName) throws IOException { - File dir = new File(SystemUtil.configHome + "data" + File.separator + "template_data" + File.separator); - File file = new File(SystemUtil.configHome + "data" + File.separator + "template_data" + File.separator - + msgName + ".csv"); - if (!file.exists()) { - dir.mkdirs(); - file.createNewFile(); - } - - CSVWriter writer = new CSVWriter(new FileWriter(file)); - - List records = new ArrayList(); - - // 如果table为空,则初始化 - if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) { - Init.initTemplateDataTable(); - } - - // 逐行读取 - DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable() - .getModel(); - int rowCount = tableModel.getRowCount(); - String[] arryData; - for (int i = 0; i < rowCount; i++) { - arryData = new String[3]; - arryData[0] = (String) tableModel.getValueAt(i, 0); - arryData[1] = (String) tableModel.getValueAt(i, 1); - arryData[2] = ((String) tableModel.getValueAt(i, 2)).trim(); - records.add(arryData); - } - - // 写入文件 - writer.writeAll(records); - writer.close(); - } - -} diff --git a/src/main/java/com/fangxuele/tool/push/logic/PushData.java b/src/main/java/com/fangxuele/tool/push/logic/PushData.java index 2e2dcfc8..ce935f09 100644 --- a/src/main/java/com/fangxuele/tool/push/logic/PushData.java +++ b/src/main/java/com/fangxuele/tool/push/logic/PushData.java @@ -1,5 +1,7 @@ package com.fangxuele.tool.push.logic; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.LongAdder; @@ -16,7 +18,7 @@ public class PushData { /** * 导入的用户 */ - public static List allUser; + public static List allUser = Collections.synchronizedList(new ArrayList<>()); /** * 总记录数 @@ -32,7 +34,6 @@ public class PushData { * 发送失败数 */ public static LongAdder failRecords = new LongAdder(); - ; /** * 准备发送的列表 diff --git a/src/main/java/com/fangxuele/tool/push/logic/PushManage.java b/src/main/java/com/fangxuele/tool/push/logic/PushManage.java index a5d90327..fe8d5606 100644 --- a/src/main/java/com/fangxuele/tool/push/logic/PushManage.java +++ b/src/main/java/com/fangxuele/tool/push/logic/PushManage.java @@ -13,8 +13,16 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.IClientProfile; +import com.fangxuele.tool.push.dao.TPushHistoryMapper; +import com.fangxuele.tool.push.domain.TPushHistory; import com.fangxuele.tool.push.ui.Init; -import com.fangxuele.tool.push.ui.form.MainWindow; +import com.fangxuele.tool.push.ui.form.MessageEditForm; +import com.fangxuele.tool.push.ui.form.PushForm; +import com.fangxuele.tool.push.ui.form.PushHisForm; +import com.fangxuele.tool.push.ui.form.SettingForm; +import com.fangxuele.tool.push.ui.listener.MemberListener; +import com.fangxuele.tool.push.util.MybatisUtil; +import com.fangxuele.tool.push.util.SqliteUtil; import com.fangxuele.tool.push.util.SystemUtil; import com.github.qcloudsms.SmsSingleSender; import com.github.qcloudsms.SmsSingleSenderResult; @@ -26,7 +34,6 @@ import com.yunpian.sdk.YunpianClient; import com.yunpian.sdk.model.Result; import com.yunpian.sdk.model.SmsSingleSend; -import me.chanjar.weixin.mp.api.WxMpConfigStorage; import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; @@ -38,7 +45,9 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** *
@@ -52,11 +61,21 @@ public class PushManage {
 
     private static final Log logger = LogFactory.get();
 
+    private static TPushHistoryMapper pushHistoryMapper = MybatisUtil.getSqlSession().getMapper(TPushHistoryMapper.class);
+
     /**
      * 模板变量前缀
      */
     public static final String TEMPLATE_VAR_PREFIX = "var";
 
+    private volatile static WxMpService wxMpService;
+
+    private volatile static WxMpInMemoryConfigStorage wxMpConfigStorage;
+
+    private volatile static WxMaService wxMaService;
+
+    private volatile static WxMaInMemoryConfig wxMaConfigStorage;
+
     /**
      * 预览消息
      *
@@ -65,12 +84,12 @@ public class PushManage {
     public static boolean preview() throws Exception {
         List msgDataList = new ArrayList<>();
 
-        for (String data : MainWindow.mainWindow.getPreviewUserField().getText().split(";")) {
-            msgDataList.add(data.split(","));
+        for (String data : MessageEditForm.messageEditForm.getPreviewUserField().getText().split(";")) {
+            msgDataList.add(data.split(MemberListener.TXT_FILE_DATA_SEPERATOR_REGEX));
         }
 
-        switch (Objects.requireNonNull(MainWindow.mainWindow.getMsgTypeComboBox().getSelectedItem()).toString()) {
-            case MessageTypeConsts.MP_TEMPLATE:
+        switch (Init.config.getMsgType()) {
+            case MessageTypeEnum.MP_TEMPLATE_CODE:
                 WxMpTemplateMessage wxMessageTemplate;
                 WxMpService wxMpService = getWxMpService();
                 if (wxMpService.getWxMpConfigStorage() == null) {
@@ -84,7 +103,7 @@ public static boolean preview() throws Exception {
                     wxMpService.getTemplateMsgService().sendTemplateMsg(wxMessageTemplate);
                 }
                 break;
-            case MessageTypeConsts.MA_TEMPLATE:
+            case MessageTypeEnum.MA_TEMPLATE_CODE:
                 WxMaTemplateMessage wxMaMessageTemplate;
                 WxMaService wxMaService = getWxMaService();
                 if (wxMaService.getWxMaConfig() == null) {
@@ -99,7 +118,7 @@ public static boolean preview() throws Exception {
                     wxMaService.getMsgService().sendTemplateMsg(wxMaMessageTemplate);
                 }
                 break;
-            case MessageTypeConsts.KEFU:
+            case MessageTypeEnum.KEFU_CODE:
                 wxMpService = getWxMpService();
                 WxMpKefuMessage wxMpKefuMessage;
                 if (wxMpService.getWxMpConfigStorage() == null) {
@@ -113,7 +132,7 @@ public static boolean preview() throws Exception {
                     wxMpService.getKefuService().sendKefuMessage(wxMpKefuMessage);
                 }
                 break;
-            case MessageTypeConsts.KEFU_PRIORITY:
+            case MessageTypeEnum.KEFU_PRIORITY_CODE:
                 wxMpService = getWxMpService();
                 if (wxMpService.getWxMpConfigStorage() == null) {
                     return false;
@@ -133,12 +152,12 @@ public static boolean preview() throws Exception {
                     }
                 }
                 break;
-            case MessageTypeConsts.ALI_YUN:
-                String aliyunAccessKeyId = Init.configer.getAliyunAccessKeyId();
-                String aliyunAccessKeySecret = Init.configer.getAliyunAccessKeySecret();
+            case MessageTypeEnum.ALI_YUN_CODE:
+                String aliyunAccessKeyId = Init.config.getAliyunAccessKeyId();
+                String aliyunAccessKeySecret = Init.config.getAliyunAccessKeySecret();
 
                 if (StringUtils.isEmpty(aliyunAccessKeyId) || StringUtils.isEmpty(aliyunAccessKeySecret)) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
                             "请先在设置中填写并保存阿里云短信相关配置!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                     return false;
@@ -160,12 +179,12 @@ public static boolean preview() throws Exception {
                     }
                 }
                 break;
-            case MessageTypeConsts.TX_YUN:
-                String txyunAppId = Init.configer.getTxyunAppId();
-                String txyunAppKey = Init.configer.getTxyunAppKey();
+            case MessageTypeEnum.TX_YUN_CODE:
+                String txyunAppId = Init.config.getTxyunAppId();
+                String txyunAppKey = Init.config.getTxyunAppKey();
 
                 if (StringUtils.isEmpty(txyunAppId) || StringUtils.isEmpty(txyunAppKey)) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
                             "请先在设置中填写并保存腾讯云短信相关配置!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                     return false;
@@ -176,21 +195,21 @@ public static boolean preview() throws Exception {
                 for (String[] msgData : msgDataList) {
                     String[] params = MessageMaker.makeTxyunMessage(msgData);
                     SmsSingleSenderResult result = ssender.sendWithParam("86", msgData[0],
-                            Integer.valueOf(MainWindow.mainWindow.getMsgTemplateIdTextField().getText()),
-                            params, Init.configer.getAliyunSign(), "", "");
+                            Integer.valueOf(MessageEditForm.messageEditForm.getMsgTemplateIdTextField().getText()),
+                            params, Init.config.getAliyunSign(), "", "");
                     if (result.result != 0) {
                         throw new Exception(result.toString());
                     }
                 }
                 break;
-            case MessageTypeConsts.ALI_TEMPLATE:
-                String aliServerUrl = Init.configer.getAliServerUrl();
-                String aliAppKey = Init.configer.getAliAppKey();
-                String aliAppSecret = Init.configer.getAliAppSecret();
+            case MessageTypeEnum.ALI_TEMPLATE_CODE:
+                String aliServerUrl = Init.config.getAliServerUrl();
+                String aliAppKey = Init.config.getAliAppKey();
+                String aliAppSecret = Init.config.getAliAppSecret();
 
                 if (StringUtils.isEmpty(aliServerUrl) || StringUtils.isEmpty(aliAppKey)
                         || StringUtils.isEmpty(aliAppSecret)) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
                             "请先在设置中填写并保存阿里大于相关配置!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                     return false;
@@ -207,11 +226,11 @@ public static boolean preview() throws Exception {
                     }
                 }
                 break;
-            case MessageTypeConsts.YUN_PIAN:
-                String yunpianApiKey = Init.configer.getYunpianApiKey();
+            case MessageTypeEnum.YUN_PIAN_CODE:
+                String yunpianApiKey = Init.config.getYunpianApiKey();
 
                 if (StringUtils.isEmpty(yunpianApiKey)) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
                             "请先在设置中填写并保存云片网短信相关配置!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                     return false;
@@ -240,21 +259,21 @@ public static boolean preview() throws Exception {
      *
      * @return WxMpConfigStorage
      */
-    private static WxMpConfigStorage wxMpConfigStorage() {
-        WxMpInMemoryConfigStorage configStorage = new WxMpInMemoryConfigStorage();
-        if (StringUtils.isEmpty(Init.configer.getWechatAppId()) || StringUtils.isEmpty(Init.configer.getWechatAppSecret())) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请先在设置中填写并保存公众号相关配置!", "提示",
+    private static WxMpInMemoryConfigStorage wxMpConfigStorage() {
+        if (StringUtils.isEmpty(Init.config.getWechatAppId()) || StringUtils.isEmpty(Init.config.getWechatAppSecret())) {
+            JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "请先在设置中填写并保存公众号相关配置!", "提示",
                     JOptionPane.INFORMATION_MESSAGE);
-            MainWindow.mainWindow.getScheduleRunButton().setEnabled(true);
-            MainWindow.mainWindow.getPushStartButton().setEnabled(true);
-            MainWindow.mainWindow.getPushStopButton().setEnabled(false);
-            MainWindow.mainWindow.getPushTotalProgressBar().setIndeterminate(false);
+            PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+            PushForm.pushForm.getPushStartButton().setEnabled(true);
+            PushForm.pushForm.getPushStopButton().setEnabled(false);
+            PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
             return null;
         }
-        configStorage.setAppId(Init.configer.getWechatAppId());
-        configStorage.setSecret(Init.configer.getWechatAppSecret());
-        configStorage.setToken(Init.configer.getWechatToken());
-        configStorage.setAesKey(Init.configer.getWechatAesKey());
+        WxMpInMemoryConfigStorage configStorage = new WxMpInMemoryConfigStorage();
+        configStorage.setAppId(Init.config.getWechatAppId());
+        configStorage.setSecret(Init.config.getWechatAppSecret());
+        configStorage.setToken(Init.config.getWechatToken());
+        configStorage.setAesKey(Init.config.getWechatAesKey());
         return configStorage;
     }
 
@@ -265,20 +284,20 @@ private static WxMpConfigStorage wxMpConfigStorage() {
      */
     private static WxMaInMemoryConfig wxMaConfigStorage() {
         WxMaInMemoryConfig configStorage = new WxMaInMemoryConfig();
-        if (StringUtils.isEmpty(Init.configer.getMiniAppAppId()) || StringUtils.isEmpty(Init.configer.getMiniAppAppSecret())
-                || StringUtils.isEmpty(Init.configer.getMiniAppToken()) || StringUtils.isEmpty(Init.configer.getMiniAppAesKey())) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请先在设置中填写并保存小程序相关配置!", "提示",
+        if (StringUtils.isEmpty(Init.config.getMiniAppAppId()) || StringUtils.isEmpty(Init.config.getMiniAppAppSecret())
+                || StringUtils.isEmpty(Init.config.getMiniAppToken()) || StringUtils.isEmpty(Init.config.getMiniAppAesKey())) {
+            JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "请先在设置中填写并保存小程序相关配置!", "提示",
                     JOptionPane.INFORMATION_MESSAGE);
-            MainWindow.mainWindow.getScheduleRunButton().setEnabled(true);
-            MainWindow.mainWindow.getPushStartButton().setEnabled(true);
-            MainWindow.mainWindow.getPushStopButton().setEnabled(false);
-            MainWindow.mainWindow.getPushTotalProgressBar().setIndeterminate(false);
+            PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+            PushForm.pushForm.getPushStartButton().setEnabled(true);
+            PushForm.pushForm.getPushStopButton().setEnabled(false);
+            PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
             return null;
         }
-        configStorage.setAppid(Init.configer.getMiniAppAppId());
-        configStorage.setSecret(Init.configer.getMiniAppAppSecret());
-        configStorage.setToken(Init.configer.getMiniAppToken());
-        configStorage.setAesKey(Init.configer.getMiniAppAesKey());
+        configStorage.setAppid(Init.config.getMiniAppAppId());
+        configStorage.setSecret(Init.config.getMiniAppAppSecret());
+        configStorage.setToken(Init.config.getMiniAppToken());
+        configStorage.setAesKey(Init.config.getMiniAppAesKey());
         configStorage.setMsgDataFormat("JSON");
         return configStorage;
     }
@@ -289,10 +308,22 @@ private static WxMaInMemoryConfig wxMaConfigStorage() {
      * @return WxMpService
      */
     public static WxMpService getWxMpService() {
-        WxMpService wxMpService = new WxMpServiceImpl();
-        WxMpConfigStorage wxMpConfigStorage = wxMpConfigStorage();
-        if (wxMpConfigStorage != null) {
-            wxMpService.setWxMpConfigStorage(wxMpConfigStorage);
+        if (wxMpService == null) {
+            synchronized (PushManage.class) {
+                if (wxMpService == null) {
+                    wxMpService = new WxMpServiceImpl();
+                }
+            }
+        }
+        if (wxMpConfigStorage == null) {
+            synchronized (PushManage.class) {
+                if (wxMpConfigStorage == null) {
+                    wxMpConfigStorage = wxMpConfigStorage();
+                    if (wxMpConfigStorage != null) {
+                        wxMpService.setWxMpConfigStorage(wxMpConfigStorage);
+                    }
+                }
+            }
         }
         return wxMpService;
     }
@@ -303,8 +334,23 @@ public static WxMpService getWxMpService() {
      * @return WxMaService
      */
     static WxMaService getWxMaService() {
-        WxMaService wxMaService = new WxMaServiceImpl();
-        wxMaService.setWxMaConfig(wxMaConfigStorage());
+        if (wxMaService == null) {
+            synchronized (PushManage.class) {
+                if (wxMaService == null) {
+                    wxMaService = new WxMaServiceImpl();
+                }
+            }
+        }
+        if (wxMaConfigStorage == null) {
+            synchronized (PushManage.class) {
+                if (wxMaConfigStorage == null) {
+                    wxMaConfigStorage = wxMaConfigStorage();
+                    if (wxMaConfigStorage != null) {
+                        wxMaService.setWxMaConfig(wxMaConfigStorage);
+                    }
+                }
+            }
+        }
         return wxMaService;
     }
 
@@ -317,26 +363,37 @@ static void savePushData() throws IOException {
             pushHisDir.mkdirs();
         }
 
-        String msgName = MainWindow.mainWindow.getMsgNameField().getText();
-        String nowTime = DateUtil.now().replaceAll(":", "_");
-
-        String[] strArray;
+        String msgName = MessageEditForm.messageEditForm.getMsgNameField().getText();
+        String nowTime = DateUtil.now().replace(":", "_").replace(" ", "_");
         CSVWriter writer;
+        int msgType = Init.config.getMsgType();
+        String now = SqliteUtil.nowDateForSqlite();
 
         // 保存已发送
         if (PushData.sendSuccessList.size() > 0) {
-            File toSendFile = new File(SystemUtil.configHome + "data" +
-                    File.separator + "push_his" + File.separator + msgName +
+            File sendSuccessFile = new File(SystemUtil.configHome + "data" +
+                    File.separator + "push_his" + File.separator + MessageTypeEnum.getName(msgType) + "-" + msgName +
                     "-发送成功-" + nowTime + ".csv");
-            if (!toSendFile.exists()) {
-                toSendFile.createNewFile();
+            if (!sendSuccessFile.exists()) {
+                sendSuccessFile.createNewFile();
             }
-            writer = new CSVWriter(new FileWriter(toSendFile));
+            writer = new CSVWriter(new FileWriter(sendSuccessFile));
 
             for (String[] str : PushData.sendSuccessList) {
                 writer.writeNext(str);
             }
             writer.close();
+
+            TPushHistory tPushHistory = new TPushHistory();
+//          TODO  tPushHistory.setMsgId(0);
+            tPushHistory.setMsgType(msgType);
+            tPushHistory.setMsgName(msgName);
+            tPushHistory.setResult("发送成功");
+            tPushHistory.setCsvFile(sendSuccessFile.getAbsolutePath());
+            tPushHistory.setCreateTime(now);
+            tPushHistory.setModifiedTime(now);
+
+            pushHistoryMapper.insertSelective(tPushHistory);
         }
 
         // 保存未发送
@@ -348,7 +405,7 @@ static void savePushData() throws IOException {
         }
         if (PushData.toSendList.size() > 0) {
             File unSendFile = new File(SystemUtil.configHome + "data" + File.separator +
-                    "push_his" + File.separator + msgName + "-未发送-" + nowTime +
+                    "push_his" + File.separator + MessageTypeEnum.getName(msgType) + "-" + msgName + "-未发送-" + nowTime +
                     ".csv");
             if (!unSendFile.exists()) {
                 unSendFile.createNewFile();
@@ -358,12 +415,23 @@ static void savePushData() throws IOException {
                 writer.writeNext(str);
             }
             writer.close();
+
+            TPushHistory tPushHistory = new TPushHistory();
+//          TODO  tPushHistory.setMsgId(0);
+            tPushHistory.setMsgType(msgType);
+            tPushHistory.setMsgName(msgName);
+            tPushHistory.setResult("未发送");
+            tPushHistory.setCsvFile(unSendFile.getAbsolutePath());
+            tPushHistory.setCreateTime(now);
+            tPushHistory.setModifiedTime(now);
+
+            pushHistoryMapper.insertSelective(tPushHistory);
         }
 
         // 保存发送失败
         if (PushData.sendFailList.size() > 0) {
             File failSendFile = new File(SystemUtil.configHome + "data" + File.separator +
-                    "push_his" + File.separator + msgName + "-发送失败-" + nowTime + ".csv");
+                    "push_his" + File.separator + MessageTypeEnum.getName(msgType) + "-" + msgName + "-发送失败-" + nowTime + ".csv");
             if (!failSendFile.exists()) {
                 failSendFile.createNewFile();
             }
@@ -372,10 +440,20 @@ static void savePushData() throws IOException {
                 writer.writeNext(str);
             }
             writer.close();
+
+            TPushHistory tPushHistory = new TPushHistory();
+//          TODO  tPushHistory.setMsgId(0);
+            tPushHistory.setMsgType(msgType);
+            tPushHistory.setMsgName(msgName);
+            tPushHistory.setResult("发送失败");
+            tPushHistory.setCsvFile(failSendFile.getAbsolutePath());
+            tPushHistory.setCreateTime(now);
+            tPushHistory.setModifiedTime(now);
+
+            pushHistoryMapper.insertSelective(tPushHistory);
         }
 
-        Init.initMemberTab();
-        Init.initSettingTab();
+        PushHisForm.init();
     }
 
     /**
@@ -384,8 +462,8 @@ static void savePushData() throws IOException {
      * @param log
      */
     public static void console(String log) {
-        MainWindow.mainWindow.getPushConsoleTextArea().append(log + "\n");
-        MainWindow.mainWindow.getPushConsoleTextArea().setCaretPosition(MainWindow.mainWindow.getPushConsoleTextArea().getText().length());
+        PushForm.pushForm.getPushConsoleTextArea().append(log + "\n");
+        PushForm.pushForm.getPushConsoleTextArea().setCaretPosition(PushForm.pushForm.getPushConsoleTextArea().getText().length());
         logger.warn(log);
     }
 
diff --git a/src/main/java/com/fangxuele/tool/push/logic/RunPushThread.java b/src/main/java/com/fangxuele/tool/push/logic/RunPushThread.java
index fc2e8047..eb9a8606 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/RunPushThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/RunPushThread.java
@@ -3,13 +3,16 @@
 import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.hutool.core.date.BetweenFormater;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
 import com.fangxuele.tool.push.ui.Init;
 import com.fangxuele.tool.push.ui.component.TableInCellProgressBarRenderer;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.PushForm;
+import com.fangxuele.tool.push.ui.form.SettingForm;
 import me.chanjar.weixin.mp.api.WxMpService;
+import org.apache.commons.lang3.StringUtils;
 
 import javax.swing.*;
 import javax.swing.table.DefaultTableCellRenderer;
@@ -17,7 +20,6 @@
 import java.io.IOException;
 import java.util.Collections;
 import java.util.LinkedList;
-import java.util.Objects;
 import java.util.concurrent.ThreadPoolExecutor;
 
 /**
@@ -34,18 +36,18 @@ public class RunPushThread extends Thread {
 
     @Override
     public void run() {
-        MainWindow.mainWindow.getPushStopButton().setText("停止");
+        PushForm.pushForm.getPushStopButton().setText("停止");
 
         // 初始化
-        MainWindow.mainWindow.getPushTotalProgressBar().setIndeterminate(true);
+        PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(true);
         PushData.running = true;
         PushData.successRecords.reset();
         PushData.failRecords.reset();
         PushData.stopedThreadCount.reset();
         PushData.threadCount = 0;
 
-        MainWindow.mainWindow.getPushSuccessCount().setText("0");
-        MainWindow.mainWindow.getPushFailCount().setText("0");
+        PushForm.pushForm.getPushSuccessCount().setText("0");
+        PushForm.pushForm.getPushFailCount().setText("0");
 
         PushData.toSendList = Collections.synchronizedList(new LinkedList<>());
         PushData.sendSuccessList = Collections.synchronizedList(new LinkedList<>());
@@ -53,104 +55,158 @@ public void run() {
 
         PushManage.console("推送开始……");
 
-        // 页大小
-        int pageSize = Integer.parseInt(MainWindow.mainWindow.getPushPageSizeTextField().getText());
-        Init.configer.setRecordPerPage(pageSize);
-        Init.configer.save();
-        PushManage.console("页大小:" + pageSize);
-
         // 拷贝准备的目标用户
         PushData.toSendList.addAll(PushData.allUser);
         // 总记录数
         long totalCount = PushData.toSendList.size();
         PushData.totalRecords = totalCount;
 
-        MainWindow.mainWindow.getPushTotalCountLabel().setText("总用户数:" + totalCount);
-        MainWindow.mainWindow.getPushTotalProgressBar().setMaximum((int) totalCount);
-        PushManage.console("总用户数:" + totalCount);
-        // 总页数
-        int totalPage = Long.valueOf((totalCount + pageSize - 1) / pageSize).intValue();
-        MainWindow.mainWindow.getPushTotalPageLabel().setText("总页数:" + totalPage);
-        PushManage.console("总页数:" + totalPage);
-
-        // 每个线程分配多少页
-        int pagePerThread = Integer.parseInt(MainWindow.mainWindow.getPushPagePerThreadTextField().getText());
-        Init.configer.setPagePerThread(pagePerThread);
-        Init.configer.save();
-        PushManage.console("每个线程分配:" + pagePerThread + "页");
-
-        // 需要多少个线程
-        int threadCount = (totalPage + pagePerThread - 1) / pagePerThread;
+        PushForm.pushForm.getPushTotalCountLabel().setText("消息总数:" + totalCount);
+        PushForm.pushForm.getPushTotalProgressBar().setMaximum((int) totalCount);
+        PushManage.console("消息总数:" + totalCount);
+        // 可用处理器核心数量
+        PushForm.pushForm.getAvailableProcessorLabel().setText("可用处理器核心:" + Runtime.getRuntime().availableProcessors());
+        PushManage.console("可用处理器核心:" + Runtime.getRuntime().availableProcessors());
+
+        // 线程数
+        Init.config.setThreadCount(Integer.parseInt(PushForm.pushForm.getThreadCountTextField().getText()));
+        Init.config.save();
+        PushManage.console("线程数:" + PushForm.pushForm.getThreadCountTextField().getText());
+
+        // 线程池大小
+        Init.config.setMaxThreadPool(Integer.parseInt(PushForm.pushForm.getMaxThreadPoolTextField().getText()));
+        Init.config.save();
+        PushManage.console("线程池大小:" + PushForm.pushForm.getMaxThreadPoolTextField().getText());
+
+        // JVM内存占用
+        PushForm.pushForm.getJvmMemoryLabel().setText("JVM内存占用:" + FileUtil.readableFileSize(Runtime.getRuntime().totalMemory()) + "/" + FileUtil.readableFileSize(Runtime.getRuntime().maxMemory()));
+        // 线程数
+        int threadCount = Integer.parseInt(PushForm.pushForm.getThreadCountTextField().getText());
         PushData.threadCount = threadCount;
-        MainWindow.mainWindow.getPushTotalThreadLabel().setText("需要线程宝宝个数:" + threadCount);
-        PushManage.console("需要:" + threadCount + "个线程宝宝齐力合作");
 
         // 初始化线程table
-        String[] headerNames = {"线程", "页数区间", "成功", "失败", "总数", "当前进度"};
+        String[] headerNames = {"线程", "分片区间", "成功", "失败", "总数", "当前进度"};
         DefaultTableModel tableModel = new DefaultTableModel(null, headerNames);
-        MainWindow.mainWindow.getPushThreadTable().setModel(tableModel);
-        MainWindow.mainWindow.getPushThreadTable().getColumn("当前进度").setCellRenderer(new TableInCellProgressBarRenderer());
+        PushForm.pushForm.getPushThreadTable().setModel(tableModel);
+        PushForm.pushForm.getPushThreadTable().getColumn("当前进度").setCellRenderer(new TableInCellProgressBarRenderer());
 
-        DefaultTableCellRenderer hr = (DefaultTableCellRenderer) MainWindow.mainWindow.getPushThreadTable().getTableHeader()
+        DefaultTableCellRenderer hr = (DefaultTableCellRenderer) PushForm.pushForm.getPushThreadTable().getTableHeader()
                 .getDefaultRenderer();
-        // 表头列名居中
+        // 表头列名居左
         hr.setHorizontalAlignment(DefaultTableCellRenderer.LEFT);
-        MainWindow.mainWindow.getPushThreadTable().updateUI();
+        PushForm.pushForm.getPushThreadTable().updateUI();
 
         Object[] data;
-        String msgType = Objects.requireNonNull(MainWindow.mainWindow.getMsgTypeComboBox().getSelectedItem()).toString();
+        int msgType = Init.config.getMsgType();
 
-        ThreadPoolExecutor threadPoolExecutor = ThreadUtil.newExecutor(20, 100 * Runtime.getRuntime().availableProcessors());
+        int maxThreadPoolSize = Integer.parseInt(PushForm.pushForm.getMaxThreadPoolTextField().getText());
+        ThreadPoolExecutor threadPoolExecutor = ThreadUtil.newExecutor(maxThreadPoolSize, maxThreadPoolSize);
         BaseMsgServiceThread thread = null;
+        // 每个线程分配
+        int perThread = (int) (totalCount / threadCount) + 1;
         for (int i = 0; i < threadCount; i++) {
-            if (MessageTypeConsts.MP_TEMPLATE.equals(msgType)) {
-                thread = new TemplateMsgMpServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
+            int startIndex = i * perThread;
+            if (startIndex > totalCount - 1) {
+                threadCount = i;
+                break;
+            }
+            int endIndex = i * perThread + perThread;
+            if (endIndex > totalCount - 1) {
+                endIndex = (int) (totalCount);
+            }
+            if (MessageTypeEnum.MP_TEMPLATE_CODE == msgType) {
+                thread = new TemplateMsgMpServiceThread(startIndex, endIndex);
 
                 WxMpService wxMpService = PushManage.getWxMpService();
                 if (wxMpService.getWxMpConfigStorage() == null) {
                     return;
                 }
                 thread.setWxMpService(wxMpService);
-            } else if (MessageTypeConsts.MA_TEMPLATE.equals(msgType)) {
-                thread = new TemplateMsgMaServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
+            } else if (MessageTypeEnum.MA_TEMPLATE_CODE == msgType) {
+                thread = new TemplateMsgMaServiceThread(startIndex, endIndex);
 
                 WxMaService wxMaService = PushManage.getWxMaService();
                 if (wxMaService.getWxMaConfig() == null) {
                     return;
                 }
                 ((TemplateMsgMaServiceThread) thread).setWxMaService(wxMaService);
-            } else if (MessageTypeConsts.KEFU.equals(msgType)) {
-                thread = new KeFuMsgServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
+            } else if (MessageTypeEnum.KEFU_CODE == msgType) {
+                thread = new KeFuMsgServiceThread(startIndex, endIndex);
 
                 WxMpService wxMpService = PushManage.getWxMpService();
                 if (wxMpService.getWxMpConfigStorage() == null) {
                     return;
                 }
                 thread.setWxMpService(wxMpService);
-            } else if (MessageTypeConsts.KEFU_PRIORITY.equals(msgType)) {
-                thread = new KeFuPriorMsgServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
+            } else if (MessageTypeEnum.KEFU_PRIORITY_CODE == msgType) {
+                thread = new KeFuPriorMsgServiceThread(startIndex, endIndex);
 
                 WxMpService wxMpService = PushManage.getWxMpService();
                 if (wxMpService.getWxMpConfigStorage() == null) {
                     return;
                 }
                 thread.setWxMpService(wxMpService);
-            } else if (MessageTypeConsts.ALI_TEMPLATE.equals(msgType)) {
-                thread = new AliDayuTemplateSmsMsgServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
-            } else if (MessageTypeConsts.ALI_YUN.equals(msgType)) {
-                thread = new AliYunSmsMsgServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
-            } else if (MessageTypeConsts.TX_YUN.equals(msgType)) {
-                thread = new TxYunSmsMsgServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
-            } else if (MessageTypeConsts.YUN_PIAN.equals(msgType)) {
-                thread = new YunpianSmsMsgServiceThread(i * pagePerThread,
-                        i * pagePerThread + pagePerThread - 1, pageSize);
+            } else if (MessageTypeEnum.ALI_TEMPLATE_CODE == msgType) {
+                String aliServerUrl = Init.config.getAliServerUrl();
+                String aliAppKey = Init.config.getAliAppKey();
+                String aliAppSecret = Init.config.getAliAppSecret();
+
+                if (StringUtils.isEmpty(aliServerUrl) || StringUtils.isEmpty(aliAppKey)
+                        || StringUtils.isEmpty(aliAppSecret)) {
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
+                            "请先在设置中填写并保存阿里大于相关配置!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                    PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+                    PushForm.pushForm.getPushStartButton().setEnabled(true);
+                    PushForm.pushForm.getPushStopButton().setEnabled(false);
+                    PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
+                    return;
+                }
+                thread = new AliDayuTemplateSmsMsgServiceThread(startIndex, endIndex);
+            } else if (MessageTypeEnum.ALI_YUN_CODE == msgType) {
+                String aliyunAccessKeyId = Init.config.getAliyunAccessKeyId();
+                String aliyunAccessKeySecret = Init.config.getAliyunAccessKeySecret();
+
+                if (StringUtils.isEmpty(aliyunAccessKeyId) || StringUtils.isEmpty(aliyunAccessKeySecret)) {
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
+                            "请先在设置中填写并保存阿里云短信相关配置!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                    PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+                    PushForm.pushForm.getPushStartButton().setEnabled(true);
+                    PushForm.pushForm.getPushStopButton().setEnabled(false);
+                    PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
+                    return;
+                }
+                thread = new AliYunSmsMsgServiceThread(startIndex, endIndex);
+            } else if (MessageTypeEnum.TX_YUN_CODE == msgType) {
+                String txyunAppId = Init.config.getTxyunAppId();
+                String txyunAppKey = Init.config.getTxyunAppKey();
+
+                if (StringUtils.isEmpty(txyunAppId) || StringUtils.isEmpty(txyunAppKey)) {
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
+                            "请先在设置中填写并保存腾讯云短信相关配置!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                    PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+                    PushForm.pushForm.getPushStartButton().setEnabled(true);
+                    PushForm.pushForm.getPushStopButton().setEnabled(false);
+                    PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
+                    return;
+                }
+                thread = new TxYunSmsMsgServiceThread(startIndex, endIndex);
+            } else if (MessageTypeEnum.YUN_PIAN_CODE == msgType) {
+                String yunpianApiKey = Init.config.getYunpianApiKey();
+                if (StringUtils.isEmpty(yunpianApiKey)) {
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(),
+                            "请先在设置中填写并保存云片网短信相关配置!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                    PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+                    PushForm.pushForm.getPushStartButton().setEnabled(true);
+                    PushForm.pushForm.getPushStopButton().setEnabled(false);
+                    PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
+                    return;
+                }
+
+                thread = new YunpianSmsMsgServiceThread(startIndex, endIndex);
             }
 
             thread.setTableRow(i);
@@ -158,13 +214,13 @@ public void run() {
 
             data = new Object[6];
             data[0] = thread.getName();
-            data[1] = i * pagePerThread + "-" + (i * pagePerThread + pagePerThread - 1);
+            data[1] = startIndex + "-" + endIndex;
             data[5] = 0;
             tableModel.addRow(data);
 
             threadPoolExecutor.execute(thread);
         }
-        MainWindow.mainWindow.getPushTotalProgressBar().setIndeterminate(false);
+        PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
         PushManage.console("所有线程宝宝启动完毕……");
 
         long startTimeMillis = System.currentTimeMillis();
@@ -172,43 +228,43 @@ public void run() {
         while (true) {
             if (PushData.stopedThreadCount.intValue() == threadCount) {
                 if (!PushData.fixRateScheduling) {
-                    MainWindow.mainWindow.getPushStopButton().setEnabled(false);
-                    MainWindow.mainWindow.getPushStopButton().updateUI();
+                    PushForm.pushForm.getPushStopButton().setEnabled(false);
+                    PushForm.pushForm.getPushStopButton().updateUI();
                 }
 
                 String finishTip = "发送完毕!\n\n";
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     finishTip = "发送完毕!\n\n接下来将保存结果数据,请等待……\n\n";
                 }
                 if (!PushData.fixRateScheduling) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(), finishTip, "提示",
+                    JOptionPane.showMessageDialog(PushForm.pushForm.getPushPanel(), finishTip, "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                 }
 
                 // 保存停止前的数据
                 try {
                     PushManage.console("正在保存结果数据……");
-                    MainWindow.mainWindow.getPushTotalProgressBar().setIndeterminate(true);
+                    PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(true);
                     // 空跑控制
-                    if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                    if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                         PushManage.savePushData();
                     }
                     PushManage.console("结果数据保存完毕!");
                 } catch (IOException e) {
                     logger.error(e);
                 } finally {
-                    MainWindow.mainWindow.getPushTotalProgressBar().setIndeterminate(false);
+                    PushForm.pushForm.getPushTotalProgressBar().setIndeterminate(false);
                 }
 
                 if (!PushData.fixRateScheduling) {
-                    MainWindow.mainWindow.getPushStartButton().setEnabled(true);
-                    MainWindow.mainWindow.getScheduleRunButton().setEnabled(true);
-                    MainWindow.mainWindow.getPushStartButton().updateUI();
-                    MainWindow.mainWindow.getScheduleRunButton().updateUI();
+                    PushForm.pushForm.getPushStartButton().setEnabled(true);
+                    PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+                    PushForm.pushForm.getPushStartButton().updateUI();
+                    PushForm.pushForm.getScheduleRunButton().updateUI();
 
-                    MainWindow.mainWindow.getScheduleDetailLabel().setText("");
+                    PushForm.pushForm.getScheduleDetailLabel().setText("");
                 } else {
-                    MainWindow.mainWindow.getPushStopButton().setText("停止计划任务");
+                    PushForm.pushForm.getPushStopButton().setText("停止计划任务");
                 }
 
                 break;
@@ -219,10 +275,12 @@ public void run() {
             long leftTimeMillis = (long) ((double) lastTimeMillis / (PushData.sendSuccessList.size() + PushData.sendFailList.size()) * (PushData.allUser.size() - PushData.sendSuccessList.size() - PushData.sendFailList.size()));
 
             String formatBetweenLast = DateUtil.formatBetween(lastTimeMillis, BetweenFormater.Level.SECOND);
-            MainWindow.mainWindow.getPushLastTimeLabel().setText("".equals(formatBetweenLast) ? "0s" : formatBetweenLast);
+            PushForm.pushForm.getPushLastTimeLabel().setText("".equals(formatBetweenLast) ? "0s" : formatBetweenLast);
 
             String formatBetweenLeft = DateUtil.formatBetween(leftTimeMillis, BetweenFormater.Level.SECOND);
-            MainWindow.mainWindow.getPushLeftTimeLabel().setText("".equals(formatBetweenLeft) ? "0s" : formatBetweenLeft);
+            PushForm.pushForm.getPushLeftTimeLabel().setText("".equals(formatBetweenLeft) ? "0s" : formatBetweenLeft);
+
+            PushForm.pushForm.getJvmMemoryLabel().setText("JVM内存占用:" + FileUtil.readableFileSize(Runtime.getRuntime().totalMemory()) + "/" + FileUtil.readableFileSize(Runtime.getRuntime().maxMemory()));
 
             try {
                 Thread.sleep(100);
diff --git a/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMaServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMaServiceThread.java
index fc947c04..8abae6ce 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMaServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMaServiceThread.java
@@ -2,7 +2,7 @@
 
 import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.binarywang.wx.miniapp.bean.WxMaTemplateMessage;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.PushForm;
 
 /**
  * 
@@ -22,12 +22,11 @@ public class TemplateMsgMaServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param startIndex 开始索引
+     * @param endIndex   截止索引
      */
-    TemplateMsgMaServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    TemplateMsgMaServiceThread(int startIndex, int endIndex) {
+        super(startIndex, endIndex);
     }
 
     @Override
@@ -55,13 +54,13 @@ public void run() {
                 wxMaTemplateMessage.setToUser(openId);
                 wxMaTemplateMessage.setFormId(msgData[1]);
                 // 空跑控制
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     wxMaService.getMsgService().sendTemplateMsg(wxMaTemplateMessage);
                 }
 
                 // 总发送成功+1
                 PushData.increaseSuccess();
-                MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                 // 当前线程发送成功+1
                 currentThreadSuccessCount++;
@@ -72,7 +71,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -88,7 +87,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMpServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMpServiceThread.java
index c7816064..2bdab2a3 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMpServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/TemplateMsgMpServiceThread.java
@@ -1,6 +1,6 @@
 package com.fangxuele.tool.push.logic;
 
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.PushForm;
 import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
 
 /**
@@ -16,12 +16,11 @@ public class TemplateMsgMpServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param startIndex 起始页
+     * @param endIndex   截止页
      */
-    TemplateMsgMpServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    TemplateMsgMpServiceThread(int startIndex, int endIndex) {
+        super(startIndex, endIndex);
     }
 
     @Override
@@ -48,13 +47,13 @@ public void run() {
                 wxMessageTemplate = MessageMaker.makeMpTemplateMessage(msgData);
                 wxMessageTemplate.setToUser(openId);
                 // 空跑控制
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     wxMpService.getTemplateMsgService().sendTemplateMsg(wxMessageTemplate);
                 }
 
                 // 总发送成功+1
                 PushData.increaseSuccess();
-                MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                 // 当前线程发送成功+1
                 currentThreadSuccessCount++;
@@ -65,7 +64,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -81,7 +80,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/logic/TxYunSmsMsgServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/TxYunSmsMsgServiceThread.java
index b8a02563..e490e82e 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/TxYunSmsMsgServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/TxYunSmsMsgServiceThread.java
@@ -1,12 +1,10 @@
 package com.fangxuele.tool.push.logic;
 
 import com.fangxuele.tool.push.ui.Init;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.MessageEditForm;
+import com.fangxuele.tool.push.ui.form.PushForm;
 import com.github.qcloudsms.SmsSingleSender;
 import com.github.qcloudsms.SmsSingleSenderResult;
-import org.apache.commons.lang3.StringUtils;
-
-import javax.swing.*;
 
 /**
  * 
@@ -21,12 +19,11 @@ public class TxYunSmsMsgServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param startIndex 起始页
+     * @param endIndex   截止页
      */
-    TxYunSmsMsgServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    TxYunSmsMsgServiceThread(int startIndex, int endIndex) {
+        super(startIndex, endIndex);
     }
 
     @Override
@@ -35,18 +32,12 @@ public void run() {
         // 初始化当前线程
         initCurrentThread();
 
-        String txyunAppId = Init.configer.getTxyunAppId();
-        String txyunAppKey = Init.configer.getTxyunAppKey();
-
-        if (StringUtils.isEmpty(txyunAppId) || StringUtils.isEmpty(txyunAppKey)) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
-                    "请先在设置中填写并保存腾讯云短信相关配置!", "提示",
-                    JOptionPane.INFORMATION_MESSAGE);
-        }
+        String txyunAppId = Init.config.getTxyunAppId();
+        String txyunAppKey = Init.config.getTxyunAppKey();
 
         SmsSingleSender ssender = new SmsSingleSender(Integer.valueOf(txyunAppId), txyunAppKey);
-        int templateId = Integer.parseInt(MainWindow.mainWindow.getMsgTemplateIdTextField().getText());
-        String smsSign = Init.configer.getAliyunSign();
+        int templateId = Integer.parseInt(MessageEditForm.messageEditForm.getMsgTemplateIdTextField().getText());
+        String smsSign = Init.config.getAliyunSign();
 
         for (int i = 0; i < list.size(); i++) {
             if (!PushData.running) {
@@ -62,14 +53,14 @@ public void run() {
                 String[] params = MessageMaker.makeTxyunMessage(msgData);
 
                 // 空跑控制
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     SmsSingleSenderResult result = ssender.sendWithParam("86", telNum,
                             templateId, params, smsSign, "", "");
 
                     if (result.result == 0) {
                         // 总发送成功+1
                         PushData.increaseSuccess();
-                        MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                        PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                         // 当前线程发送成功+1
                         currentThreadSuccessCount++;
@@ -80,7 +71,7 @@ public void run() {
                     } else {
                         // 总发送失败+1
                         PushData.increaseFail();
-                        MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                        PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                         // 保存发送失败
                         PushData.sendFailList.add(msgData);
@@ -96,7 +87,7 @@ public void run() {
                 } else {
                     // 总发送成功+1
                     PushData.increaseSuccess();
-                    MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                    PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                     // 当前线程发送成功+1
                     currentThreadSuccessCount++;
@@ -109,7 +100,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -125,7 +116,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/logic/YunpianSmsMsgServiceThread.java b/src/main/java/com/fangxuele/tool/push/logic/YunpianSmsMsgServiceThread.java
index 8cfab9bc..ac0da19b 100644
--- a/src/main/java/com/fangxuele/tool/push/logic/YunpianSmsMsgServiceThread.java
+++ b/src/main/java/com/fangxuele/tool/push/logic/YunpianSmsMsgServiceThread.java
@@ -1,13 +1,11 @@
 package com.fangxuele.tool.push.logic;
 
 import com.fangxuele.tool.push.ui.Init;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.PushForm;
 import com.yunpian.sdk.YunpianClient;
 import com.yunpian.sdk.model.Result;
 import com.yunpian.sdk.model.SmsSingleSend;
-import org.apache.commons.lang3.StringUtils;
 
-import javax.swing.*;
 import java.util.Map;
 
 /**
@@ -23,12 +21,11 @@ public class YunpianSmsMsgServiceThread extends BaseMsgServiceThread {
     /**
      * 构造函数
      *
-     * @param pageFrom 起始页
-     * @param pageTo   截止页
-     * @param pageSize 页大小
+     * @param startIndex 起始索引
+     * @param endIndex   截止索引
      */
-    YunpianSmsMsgServiceThread(int pageFrom, int pageTo, int pageSize) {
-        super(pageFrom, pageTo, pageSize);
+    YunpianSmsMsgServiceThread(int startIndex, int endIndex) {
+        super(startIndex, endIndex);
     }
 
     @Override
@@ -37,13 +34,7 @@ public void run() {
         // 初始化当前线程
         initCurrentThread();
 
-        String yunpianApiKey = Init.configer.getYunpianApiKey();
-
-        if (StringUtils.isEmpty(yunpianApiKey)) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
-                    "请先在设置中填写并保存云片网短信相关配置!", "提示",
-                    JOptionPane.INFORMATION_MESSAGE);
-        }
+        String yunpianApiKey = Init.config.getYunpianApiKey();
 
         YunpianClient clnt = new YunpianClient(yunpianApiKey).init();
 
@@ -62,13 +53,13 @@ public void run() {
                 params.put(YunpianClient.MOBILE, telNum);
 
                 // 空跑控制
-                if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) {
+                if (!PushForm.pushForm.getDryRunCheckBox().isSelected()) {
                     Result result = clnt.sms().single_send(params);
 
                     if (result.getCode() == 0) {
                         // 总发送成功+1
                         PushData.increaseSuccess();
-                        MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                        PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                         // 当前线程发送成功+1
                         currentThreadSuccessCount++;
@@ -79,7 +70,7 @@ public void run() {
                     } else {
                         // 总发送失败+1
                         PushData.increaseFail();
-                        MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                        PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                         // 保存发送失败
                         PushData.sendFailList.add(msgData);
@@ -95,7 +86,7 @@ public void run() {
                 } else {
                     // 总发送成功+1
                     PushData.increaseSuccess();
-                    MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
+                    PushForm.pushForm.getPushSuccessCount().setText(String.valueOf(PushData.successRecords));
 
                     // 当前线程发送成功+1
                     currentThreadSuccessCount++;
@@ -108,7 +99,7 @@ public void run() {
             } catch (Exception e) {
                 // 总发送失败+1
                 PushData.increaseFail();
-                MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords));
+                PushForm.pushForm.getPushFailCount().setText(String.valueOf(PushData.failRecords));
 
                 // 保存发送失败
                 PushData.sendFailList.add(msgData);
@@ -124,7 +115,7 @@ public void run() {
             tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5);
 
             // 总进度条
-            MainWindow.mainWindow.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
+            PushForm.pushForm.getPushTotalProgressBar().setValue(PushData.successRecords.intValue() + PushData.failRecords.intValue());
         }
 
         // 当前线程结束
diff --git a/src/main/java/com/fangxuele/tool/push/ui/Init.java b/src/main/java/com/fangxuele/tool/push/ui/Init.java
index 74b545e9..c910f290 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/Init.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/Init.java
@@ -1,42 +1,30 @@
 package com.fangxuele.tool.push.ui;
 
 import cn.hutool.core.thread.ThreadUtil;
-import cn.hutool.http.HttpUtil;
-import cn.hutool.json.JSONUtil;
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
 import com.alee.laf.WebLookAndFeel;
-import com.fangxuele.tool.push.bean.UserCase;
-import com.fangxuele.tool.push.logic.MessageTypeConsts;
-import com.fangxuele.tool.push.logic.MsgHisManage;
-import com.fangxuele.tool.push.ui.component.TableInCellButtonColumn;
-import com.fangxuele.tool.push.ui.component.TableInCellCheckBoxRenderer;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.AboutForm;
+import com.fangxuele.tool.push.ui.form.HelpForm;
+import com.fangxuele.tool.push.ui.form.MemberForm;
+import com.fangxuele.tool.push.ui.form.MessageEditForm;
+import com.fangxuele.tool.push.ui.form.MessageManageForm;
+import com.fangxuele.tool.push.ui.form.MessageTypeForm;
+import com.fangxuele.tool.push.ui.form.PushForm;
+import com.fangxuele.tool.push.ui.form.PushHisForm;
+import com.fangxuele.tool.push.ui.form.ScheduleForm;
+import com.fangxuele.tool.push.ui.form.SettingForm;
+import com.fangxuele.tool.push.ui.form.UserCaseForm;
 import com.fangxuele.tool.push.ui.listener.AboutListener;
 import com.fangxuele.tool.push.util.ConfigUtil;
 import com.fangxuele.tool.push.util.SystemUtil;
-import com.intellij.uiDesigner.core.GridConstraints;
-import com.intellij.uiDesigner.core.GridLayoutManager;
-import com.intellij.uiDesigner.core.Spacer;
 import org.apache.commons.lang3.StringUtils;
 import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;
 
-import javax.imageio.ImageIO;
 import javax.swing.*;
 import javax.swing.plaf.FontUIResource;
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.text.html.HTMLEditorKit;
-import javax.swing.text.html.StyleSheet;
 import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
 import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
 
 /**
  * 
@@ -53,12 +41,7 @@ public class Init {
     /**
      * 配置文件管理器对象
      */
-    public static ConfigUtil configer = ConfigUtil.getInstance();
-
-    /**
-     * 消息管理
-     */
-    public static MsgHisManage msgHisManager = MsgHisManage.getInstance();
+    public static ConfigUtil config = ConfigUtil.getInstance();
 
     /**
      * 设置全局字体
@@ -69,21 +52,21 @@ public static void initGlobalFont() {
         String lowDpiKey = "lowDpiInit";
         // 得到屏幕的尺寸
         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        if (screenSize.width <= 1366 && StringUtils.isEmpty(configer.getProps(lowDpiKey))) {
-            configer.setFontSize(13);
-            configer.setProps(lowDpiKey, "true");
-            configer.save();
+        if (screenSize.width <= 1366 && StringUtils.isEmpty(config.getProps(lowDpiKey))) {
+            config.setFontSize(13);
+            config.setProps(lowDpiKey, "true");
+            config.save();
         }
 
         // Mac高分辨率屏幕字号初始化
         String highDpiKey = "highDpiInit";
-        if (SystemUtil.isMacOs() && StringUtils.isEmpty(configer.getProps(highDpiKey))) {
-            configer.setFontSize(15);
-            configer.setProps(highDpiKey, "true");
-            configer.save();
+        if (SystemUtil.isMacOs() && StringUtils.isEmpty(config.getProps(highDpiKey))) {
+            config.setFontSize(15);
+            config.setProps(highDpiKey, "true");
+            config.save();
         }
 
-        Font fnt = new Font(configer.getFont(), Font.PLAIN, configer.getFontSize());
+        Font fnt = new Font(config.getFont(), Font.PLAIN, config.getFontSize());
         FontUIResource fontRes = new FontUIResource(fnt);
         for (Enumeration keys = UIManager.getDefaults().keys(); keys.hasMoreElements(); ) {
             Object key = keys.nextElement();
@@ -99,14 +82,14 @@ public static void initGlobalFont() {
      */
     public static void initOthers() {
         // 设置滚动条速度
-        MainWindow.mainWindow.getSettingScrollPane().getVerticalScrollBar().setUnitIncrement(15);
-        MainWindow.mainWindow.getSettingScrollPane().getVerticalScrollBar().setDoubleBuffered(true);
+        SettingForm.settingForm.getSettingScrollPane().getVerticalScrollBar().setUnitIncrement(15);
+        SettingForm.settingForm.getSettingScrollPane().getVerticalScrollBar().setDoubleBuffered(true);
 
-        MainWindow.mainWindow.getUserCaseScrollPane().getVerticalScrollBar().setUnitIncrement(15);
-        MainWindow.mainWindow.getUserCaseScrollPane().getVerticalScrollBar().setDoubleBuffered(true);
+        UserCaseForm.userCaseForm.getUserCaseScrollPane().getVerticalScrollBar().setUnitIncrement(15);
+        UserCaseForm.userCaseForm.getUserCaseScrollPane().getVerticalScrollBar().setDoubleBuffered(true);
 
         // 设置版本
-        MainWindow.mainWindow.getVersionLabel().setText(UiConsts.APP_VERSION);
+        AboutForm.aboutForm.getVersionLabel().setText(UiConsts.APP_VERSION);
     }
 
     /**
@@ -115,7 +98,7 @@ public static void initOthers() {
     public static void initTheme() {
 
         try {
-            switch (configer.getTheme()) {
+            switch (config.getTheme()) {
                 case "BeautyEye":
                     BeautyEyeLNFHelper.launchBeautyEyeLNF();
                     UIManager.put("RootPane.setupButtonVisible", false);
@@ -136,483 +119,23 @@ public static void initTheme() {
 
     }
 
-    /**
-     * 初始化使用帮助tab
-     */
-    private static void initHelpTab() {
-
-        try {
-            MainWindow.mainWindow.getHelpTextPane().setEditable(false);
-            HTMLEditorKit kit = new HTMLEditorKit();
-            MainWindow.mainWindow.getHelpTextPane().setEditorKit(kit);
-            StyleSheet styleSheet = kit.getStyleSheet();
-            styleSheet.addRule("h2{color:#FBC87A;}");
-            MainWindow.mainWindow.getHelpTextPane().setContentType("text/html; charset=utf-8");
-            MainWindow.mainWindow.getHelpTextPane().setPage(MainWindow.class.getResource("/page/help.html"));
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-    }
-
-    /**
-     * 初始化他们都在用tab
-     */
-    private static void initUserCaseTab() {
-        // 从github获取用户案例相关信息
-        String userCaseInfoContent = HttpUtil.get(UiConsts.USER_CASE_URL);
-        if (StringUtils.isNotEmpty(userCaseInfoContent)) {
-            List userCaseInfoList = JSONUtil.toList(JSONUtil.parseArray(userCaseInfoContent), UserCase.class);
-
-            JPanel userCaseListPanel = MainWindow.mainWindow.getUserCaseListPanel();
-            int listSize = userCaseInfoList.size();
-            userCaseListPanel.setLayout(new GridLayoutManager((int) Math.ceil(listSize / 2.0) + 1, 3, new Insets(0, 0, 0, 0), -1, -1));
-            for (int i = 0; i < listSize; i++) {
-                UserCase userCase = userCaseInfoList.get(i);
-                JPanel userCasePanel = new JPanel();
-                userCasePanel.setLayout(new GridLayoutManager(2, 2, new Insets(10, 10, 0, 0), -1, -1));
-
-                JLabel qrCodeLabel = new JLabel();
-                try {
-                    URL url = new URL(userCase.getQrCodeUrl());
-                    BufferedImage image = ImageIO.read(url);
-                    qrCodeLabel.setIcon(new ImageIcon(image));
-                } catch (IOException e) {
-                    e.printStackTrace();
-                    logger.error(e);
-                }
-                JLabel titleLabel = new JLabel();
-                titleLabel.setText(userCase.getTitle());
-                Font fnt = new Font(configer.getFont(), Font.BOLD, 20);
-                titleLabel.setFont(fnt);
-                JLabel descLabel = new JLabel();
-                descLabel.setText(userCase.getDesc());
-
-                userCasePanel.add(qrCodeLabel, new GridConstraints(0, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
-                userCasePanel.add(titleLabel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
-                userCasePanel.add(descLabel, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
-                userCaseListPanel.add(userCasePanel, new GridConstraints(i / 2, i % 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
-            }
-
-            final Spacer spacer1 = new Spacer();
-            userCaseListPanel.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
-            final Spacer spacer2 = new Spacer();
-            userCaseListPanel.add(spacer2, new GridConstraints((int) Math.ceil(listSize / 2.0), 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
-
-            userCaseListPanel.updateUI();
-        }
-    }
-
-    /**
-     * 初始化消息tab
-     */
-    public static void initMsgTab(String selectedMsgName) {
-        // 初始化,清空所有相关的输入框内容
-        MainWindow.mainWindow.getMsgTypeComboBox().setSelectedItem("");
-        MainWindow.mainWindow.getMsgTemplateIdTextField().setText("");
-        MainWindow.mainWindow.getMsgTemplateUrlTextField().setText("");
-        MainWindow.mainWindow.getMsgKefuMsgTypeComboBox().setSelectedItem("");
-        MainWindow.mainWindow.getMsgKefuMsgTitleTextField().setText("");
-        MainWindow.mainWindow.getMsgKefuPicUrlTextField().setText("");
-        MainWindow.mainWindow.getMsgKefuDescTextField().setText("");
-        MainWindow.mainWindow.getMsgKefuUrlTextField().setText("");
-        MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().setText("");
-        MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().setText("");
-        MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setText("");
-        MainWindow.mainWindow.getMsgYunpianMsgContentTextField().setText("");
-
-        String msgName;
-        if (StringUtils.isEmpty(selectedMsgName)) {
-            msgName = configer.getMsgName();
-        } else {
-            msgName = selectedMsgName;
-        }
-
-        MainWindow.mainWindow.getMsgNameField().setText(msgName);
-        MainWindow.mainWindow.getPreviewUserField().setText(configer.getPreviewUser());
-
-        Map msgMap = msgHisManager.readMsgHis();
-
-        if (msgMap != null && msgMap.size() != 0) {
-            if (msgMap.containsKey(msgName)) {
-                String[] msgDataArray = msgMap.get(msgName);
-                String msgType = msgDataArray[1];
-                MainWindow.mainWindow.getMsgTypeComboBox().setSelectedItem(msgType);
-                MainWindow.mainWindow.getMsgTemplateIdTextField().setText(msgDataArray[2]);
-                MainWindow.mainWindow.getMsgTemplateUrlTextField().setText(msgDataArray[3]);
-                String kefuMsgType = msgDataArray[4];
-                MainWindow.mainWindow.getMsgKefuMsgTypeComboBox().setSelectedItem(kefuMsgType);
-                MainWindow.mainWindow.getMsgKefuMsgTitleTextField().setText(msgDataArray[5]);
-                MainWindow.mainWindow.getMsgKefuPicUrlTextField().setText(msgDataArray[6]);
-                MainWindow.mainWindow.getMsgKefuDescTextField().setText(msgDataArray[7]);
-                MainWindow.mainWindow.getMsgKefuUrlTextField().setText(msgDataArray[8]);
-                if (msgDataArray.length > 12) {
-                    MainWindow.mainWindow.getMsgYunpianMsgContentTextField().setText(msgDataArray[12]);
-                }
-                if (msgDataArray.length > 11) {
-                    MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setText(msgDataArray[11]);
-                }
-                if (msgDataArray.length > 9) {
-                    MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().setText(msgDataArray[9]);
-                    MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().setText(msgDataArray[10]);
-                }
-                switchMsgType(msgType);
-                switchKefuMsgType(kefuMsgType);
-
-                // 模板消息Data表
-                List list = msgHisManager.readTemplateData(msgName);
-                String[] headerNames = {"Name", "Value", "Color", "操作"};
-                Object[][] cellData = new String[list.size()][headerNames.length];
-                for (int i = 0; i < list.size(); i++) {
-                    cellData[i] = list.get(i);
-                }
-                DefaultTableModel model = new DefaultTableModel(cellData, headerNames);
-                MainWindow.mainWindow.getTemplateMsgDataTable().setModel(model);
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().
-                        getColumn(headerNames.length - 1).
-                        setCellRenderer(new TableInCellButtonColumn(MainWindow.mainWindow.getTemplateMsgDataTable(), headerNames.length - 1));
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().
-                        getColumn(headerNames.length - 1).
-                        setCellEditor(new TableInCellButtonColumn(MainWindow.mainWindow.getTemplateMsgDataTable(), headerNames.length - 1));
-
-                // 设置列宽
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(0).setPreferredWidth(150);
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(0).setMaxWidth(150);
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(2).setPreferredWidth(130);
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(2).setMaxWidth(130);
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(3).setPreferredWidth(130);
-                MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(3).setMaxWidth(130);
-
-                MainWindow.mainWindow.getTemplateMsgDataTable().updateUI();
-            }
-        } else {
-            switchMsgType(Objects.requireNonNull(MainWindow.mainWindow.getMsgTypeComboBox().getSelectedItem()).toString());
-        }
-    }
-
-    /**
-     * 根据消息类型转换界面显示
-     *
-     * @param msgType
-     */
-    public static void switchMsgType(String msgType) {
-        MainWindow.mainWindow.getKefuMsgPanel().setVisible(false);
-        MainWindow.mainWindow.getTemplateMsgPanel().setVisible(false);
-        MainWindow.mainWindow.getYunpianMsgPanel().setVisible(false);
-        switch (msgType) {
-            case MessageTypeConsts.MP_TEMPLATE:
-                MainWindow.mainWindow.getTemplateMsgPanel().setVisible(true);
-                MainWindow.mainWindow.getTemplateUrlLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateUrlTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramAppidLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramPagePathLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel1().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel2().setVisible(true);
-                MainWindow.mainWindow.getTemplateMsgColorLabel().setVisible(true);
-                MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(false);
-                MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)");
-                break;
-            case MessageTypeConsts.MA_TEMPLATE:
-                MainWindow.mainWindow.getTemplateMsgPanel().setVisible(true);
-                MainWindow.mainWindow.getTemplateUrlLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateUrlTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramAppidLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateMiniProgramPagePathLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel1().setVisible(false);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel2().setVisible(false);
-                MainWindow.mainWindow.getTemplateMsgColorLabel().setVisible(true);
-                MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(true);
-                MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)");
-                break;
-            case MessageTypeConsts.KEFU:
-                MainWindow.mainWindow.getKefuMsgPanel().setVisible(true);
-                MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)");
-                break;
-            case MessageTypeConsts.KEFU_PRIORITY:
-                MainWindow.mainWindow.getKefuMsgPanel().setVisible(true);
-                MainWindow.mainWindow.getTemplateMsgPanel().setVisible(true);
-                MainWindow.mainWindow.getTemplateUrlLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateUrlTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramAppidLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramPagePathLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel1().setVisible(true);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel2().setVisible(true);
-                MainWindow.mainWindow.getTemplateMsgColorLabel().setVisible(true);
-                MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(true);
-                MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(false);
-                MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)");
-                break;
-            case MessageTypeConsts.ALI_YUN:
-            case MessageTypeConsts.TX_YUN:
-            case MessageTypeConsts.ALI_TEMPLATE:
-                MainWindow.mainWindow.getTemplateMsgPanel().setVisible(true);
-                MainWindow.mainWindow.getTemplateUrlLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgTemplateUrlTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateMiniProgramAppidLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateMiniProgramPagePathLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel1().setVisible(false);
-                MainWindow.mainWindow.getTemplateMiniProgramOptionalLabel2().setVisible(false);
-                MainWindow.mainWindow.getTemplateMsgColorLabel().setVisible(false);
-                MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(false);
-                MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(false);
-                MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(false);
-                MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户手机号(多个以半角分号分隔)");
-                break;
-            case MessageTypeConsts.YUN_PIAN:
-                MainWindow.mainWindow.getYunpianMsgPanel().setVisible(true);
-                MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户手机号(多个以半角分号分隔)");
-                break;
-            default:
-                break;
-        }
-    }
-
-    /**
-     * 根据客服消息类型转换界面显示
-     *
-     * @param msgType 消息类型
-     */
-    public static void switchKefuMsgType(String msgType) {
-        switch (msgType) {
-            case "文本消息":
-                MainWindow.mainWindow.getKefuMsgTitleLabel().setText("内容");
-                MainWindow.mainWindow.getKefuMsgDescLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgKefuDescTextField().setVisible(false);
-                MainWindow.mainWindow.getKefuMsgPicUrlLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgKefuPicUrlTextField().setVisible(false);
-                MainWindow.mainWindow.getMsgKefuDescTextField().setVisible(false);
-                MainWindow.mainWindow.getKefuMsgUrlLabel().setVisible(false);
-                MainWindow.mainWindow.getMsgKefuUrlTextField().setVisible(false);
-                break;
-            case "图文消息":
-                MainWindow.mainWindow.getKefuMsgTitleLabel().setText("标题");
-                MainWindow.mainWindow.getKefuMsgDescLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgKefuDescTextField().setVisible(true);
-                MainWindow.mainWindow.getKefuMsgPicUrlLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgKefuPicUrlTextField().setVisible(true);
-                MainWindow.mainWindow.getMsgKefuDescTextField().setVisible(true);
-                MainWindow.mainWindow.getKefuMsgUrlLabel().setVisible(true);
-                MainWindow.mainWindow.getMsgKefuUrlTextField().setVisible(true);
-                break;
-            default:
-                break;
-        }
-    }
-
-    /**
-     * 初始化导入用户tab
-     */
-    public static void initMemberTab() {
-        MainWindow.mainWindow.getImportFromSqlTextArea().setText(configer.getMemberSql());
-        MainWindow.mainWindow.getMemberFilePathField().setText(configer.getMemberFilePath());
-
-        MainWindow.mainWindow.getMemberHisComboBox().removeAllItems();
-
-        File pushHisDir = new File(SystemUtil.configHome + "data" + File.separator + "push_his");
-        if (!pushHisDir.exists()) {
-            pushHisDir.mkdirs();
-        }
-
-        File[] files = pushHisDir.listFiles();
-        if (Objects.requireNonNull(files).length > 0) {
-            for (File file : files) {
-                MainWindow.mainWindow.getMemberHisComboBox().addItem(file.getName());
-            }
-        }
-    }
-
-    /**
-     * 初始化推送tab
-     */
-    private static void initPushTab() {
-        MainWindow.mainWindow.getPushMsgName().setText(configer.getMsgName());
-        MainWindow.mainWindow.getPushPageSizeTextField().setText(String.valueOf(configer.getRecordPerPage()));
-        MainWindow.mainWindow.getPushPagePerThreadTextField().setText(String.valueOf(configer.getPagePerThread()));
-        MainWindow.mainWindow.getDryRunCheckBox().setSelected(configer.isDryRun());
-    }
-
-    /**
-     * 初始化计划任务tab
-     */
-    private static void initScheduleTab() {
-        // 开始
-        MainWindow.mainWindow.getRunAtThisTimeRadioButton().setSelected(configer.isRadioStartAt());
-        MainWindow.mainWindow.getStartAtThisTimeTextField().setText(configer.getTextStartAt());
-
-        //每天
-        MainWindow.mainWindow.getRunPerDayRadioButton().setSelected(configer.isRadioPerDay());
-        MainWindow.mainWindow.getStartPerDayTextField().setText(configer.getTextPerDay());
-
-        // 每周
-        MainWindow.mainWindow.getRunPerWeekRadioButton().setSelected(configer.isRadioPerWeek());
-        MainWindow.mainWindow.getSchedulePerWeekComboBox().setSelectedItem(configer.getTextPerWeekWeek());
-        MainWindow.mainWindow.getStartPerWeekTextField().setText(configer.getTextPerWeekTime());
-    }
-
-    /**
-     * 初始化推送历史tab
-     */
-    public static void initPushHisTab() {
-        // 导入历史管理
-        String[] headerNames = {"选择", "文件名称"};
-        DefaultTableModel model = new DefaultTableModel(null, headerNames);
-        MainWindow.mainWindow.getPushHisLeftTable().setModel(model);
-
-        // 隐藏表头
-        MainWindow.mainWindow.getPushHisLeftTable().getTableHeader().setVisible(false);
-        DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
-        renderer.setPreferredSize(new Dimension(0, 0));
-        MainWindow.mainWindow.getPushHisLeftTable().getTableHeader().setDefaultRenderer(renderer);
-
-        File pushHisDir = new File(SystemUtil.configHome + "data" + File.separator + "push_his");
-        if (!pushHisDir.exists()) {
-            pushHisDir.mkdirs();
-        }
-
-        File[] files = pushHisDir.listFiles();
-        Object[] data;
-        if (Objects.requireNonNull(files).length > 0) {
-            for (File file : files) {
-                data = new Object[2];
-                data[0] = false;
-                data[1] = file.getName();
-                model.addRow(data);
-            }
-        }
-        MainWindow.mainWindow.getPushHisLeftTable().getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new JCheckBox()));
-        MainWindow.mainWindow.getPushHisLeftTable().getColumnModel().getColumn(0).setCellRenderer(new TableInCellCheckBoxRenderer());
-        // 设置列宽
-        MainWindow.mainWindow.getPushHisLeftTable().getColumnModel().getColumn(0).setPreferredWidth(30);
-        MainWindow.mainWindow.getPushHisLeftTable().getColumnModel().getColumn(0).setMaxWidth(30);
-    }
-
-    /**
-     * 初始化设置tab
-     */
-    public static void initSettingTab() {
-        // 常规
-        MainWindow.mainWindow.getAutoCheckUpdateCheckBox().setSelected(configer.isAutoCheckUpdate());
-
-        // 微信公众号
-        MainWindow.mainWindow.getWechatAppIdTextField().setText(configer.getWechatAppId());
-        MainWindow.mainWindow.getWechatAppSecretPasswordField().setText(configer.getWechatAppSecret());
-        MainWindow.mainWindow.getWechatTokenPasswordField().setText(configer.getWechatToken());
-        MainWindow.mainWindow.getWechatAesKeyPasswordField().setText(configer.getWechatAesKey());
-
-        // 微信小程序
-        MainWindow.mainWindow.getMiniAppAppIdTextField().setText(configer.getMiniAppAppId());
-        MainWindow.mainWindow.getMiniAppAppSecretPasswordField().setText(configer.getMiniAppAppSecret());
-        MainWindow.mainWindow.getMiniAppTokenPasswordField().setText(configer.getMiniAppToken());
-        MainWindow.mainWindow.getMiniAppAesKeyPasswordField().setText(configer.getMiniAppAesKey());
-
-        // 阿里云短信
-        MainWindow.mainWindow.getAliyunAccessKeyIdTextField().setText(configer.getAliyunAccessKeyId());
-        MainWindow.mainWindow.getAliyunAccessKeySecretTextField().setText(configer.getAliyunAccessKeySecret());
-        MainWindow.mainWindow.getAliyunSignTextField().setText(configer.getAliyunSign());
-
-        // 阿里大于
-        MainWindow.mainWindow.getAliServerUrlTextField().setText(configer.getAliServerUrl());
-        MainWindow.mainWindow.getAliAppKeyPasswordField().setText(configer.getAliAppKey());
-        MainWindow.mainWindow.getAliAppSecretPasswordField().setText(configer.getAliAppSecret());
-        MainWindow.mainWindow.getAliSignTextField().setText(configer.getAliSign());
-
-        // 腾讯云短信
-        MainWindow.mainWindow.getTxyunAppIdTextField().setText(configer.getTxyunAppId());
-        MainWindow.mainWindow.getTxyunAppKeyTextField().setText(configer.getTxyunAppKey());
-        MainWindow.mainWindow.getTxyunSignTextField().setText(configer.getTxyunSign());
-
-        // 云片网短信
-        MainWindow.mainWindow.getYunpianApiKeyTextField().setText(configer.getYunpianApiKey());
-
-        // MySQL
-        MainWindow.mainWindow.getMysqlUrlTextField().setText(configer.getMysqlUrl());
-        MainWindow.mainWindow.getMysqlDatabaseTextField().setText(configer.getMysqlDatabase());
-        MainWindow.mainWindow.getMysqlUserTextField().setText(configer.getMysqlUser());
-        MainWindow.mainWindow.getMysqlPasswordField().setText(configer.getMysqlPassword());
-
-        // 外观
-        MainWindow.mainWindow.getSettingThemeComboBox().setSelectedItem(configer.getTheme());
-        MainWindow.mainWindow.getSettingFontNameComboBox().setSelectedItem(configer.getFont());
-        MainWindow.mainWindow.getSettingFontSizeComboBox().setSelectedItem(configer.getFontSize());
-
-        // 历史消息管理
-        String[] headerNames = {"选择", "消息名称"};
-        DefaultTableModel model = new DefaultTableModel(null, headerNames);
-        MainWindow.mainWindow.getMsgHistable().setModel(model);
-        // 隐藏表头
-        MainWindow.mainWindow.getMsgHistable().getTableHeader().setVisible(false);
-        DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
-        renderer.setPreferredSize(new Dimension(0, 0));
-        MainWindow.mainWindow.getMsgHistable().getTableHeader().setDefaultRenderer(renderer);
-
-        Map msgMap = msgHisManager.readMsgHis();
-        Object[] data;
-        for (String msgName : msgMap.keySet()) {
-            data = new Object[2];
-            data[0] = false;
-            data[1] = msgName;
-            model.addRow(data);
-        }
-        MainWindow.mainWindow.getMsgHistable().getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new JCheckBox()));
-        MainWindow.mainWindow.getMsgHistable().getColumnModel().getColumn(0).setCellRenderer(new TableInCellCheckBoxRenderer());
-        // 设置列宽
-        MainWindow.mainWindow.getMsgHistable().getColumnModel().getColumn(0).setPreferredWidth(50);
-        MainWindow.mainWindow.getMsgHistable().getColumnModel().getColumn(0).setMaxWidth(50);
-    }
-
-    /**
-     * 初始化模板消息数据table
-     */
-    public static void initTemplateDataTable() {
-        String[] headerNames = {"Name", "Value", "Color", "操作"};
-        DefaultTableModel model = new DefaultTableModel(null, headerNames);
-        MainWindow.mainWindow.getTemplateMsgDataTable().setModel(model);
-        MainWindow.mainWindow.getTemplateMsgDataTable().updateUI();
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().
-                getColumn(headerNames.length - 1).
-                setCellRenderer(new TableInCellButtonColumn(MainWindow.mainWindow.getTemplateMsgDataTable(), headerNames.length - 1));
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().
-                getColumn(headerNames.length - 1).
-                setCellEditor(new TableInCellButtonColumn(MainWindow.mainWindow.getTemplateMsgDataTable(), headerNames.length - 1));
-
-        // 设置列宽
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(0).setPreferredWidth(150);
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(0).setMaxWidth(150);
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(2).setPreferredWidth(130);
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(2).setMaxWidth(130);
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(3).setPreferredWidth(130);
-        MainWindow.mainWindow.getTemplateMsgDataTable().getColumnModel().getColumn(3).setMaxWidth(130);
-    }
-
     /**
      * 初始化所有tab
      */
     public static void initAllTab() {
-        initHelpTab();
-        ThreadUtil.execute(Init::initUserCaseTab);
-        initMsgTab(null);
-        initMemberTab();
-        initPushTab();
-        initScheduleTab();
-        // 初始化后置,切换tab时再触发
-        // initPushHisTab();
-        initSettingTab();
+        MessageTypeForm.init();
+        HelpForm.init();
+        ThreadUtil.execute(UserCaseForm::init);
+        MessageEditForm.init(null);
+        MessageManageForm.init();
+        MemberForm.init();
+        PushForm.init();
+        ScheduleForm.init();
+        SettingForm.init();
+        PushHisForm.init();
 
         // 检查新版版
-        if (configer.isAutoCheckUpdate()) {
+        if (config.isAutoCheckUpdate()) {
             ThreadUtil.execute(() -> AboutListener.checkUpdate(true));
         }
         // 更新二维码
diff --git a/src/main/java/com/fangxuele/tool/push/ui/UiConsts.java b/src/main/java/com/fangxuele/tool/push/ui/UiConsts.java
index 4896b0c4..6d54a6ce 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/UiConsts.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/UiConsts.java
@@ -16,7 +16,7 @@ public class UiConsts {
      * 软件名称,版本
      */
     public final static String APP_NAME = "WePush";
-    public final static String APP_VERSION = "v_2.3.3_190107";
+    public final static String APP_VERSION = "v_3.0.0_190516";
 
     /**
      * 主窗口图标
@@ -32,7 +32,7 @@ public class UiConsts {
     /**
      * 用户案例url
      */
-    final static String USER_CASE_URL = "http://download.zhoubochina.com/file/user_case.json";
+    public final static String USER_CASE_URL = "http://download.zhoubochina.com/file/user_case.json";
 
     /**
      * 用户案例url
diff --git a/src/main/java/com/fangxuele/tool/push/ui/component/TableInCellImageLabelRenderer.java b/src/main/java/com/fangxuele/tool/push/ui/component/TableInCellImageLabelRenderer.java
new file mode 100644
index 00000000..4e53d4d0
--- /dev/null
+++ b/src/main/java/com/fangxuele/tool/push/ui/component/TableInCellImageLabelRenderer.java
@@ -0,0 +1,36 @@
+package com.fangxuele.tool.push.ui.component;
+
+import javax.imageio.ImageIO;
+import javax.swing.*;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.net.URL;
+
+/**
+ * 
+ * 自定义图片单元格渲染器
+ * 
+ * + * @author Zhou Bo + * @since 2019/3/26. + */ +public class TableInCellImageLabelRenderer extends JLabel implements TableCellRenderer { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) { + try { + String imgUrl = (String) value; + imgUrl = imgUrl.replace("/132", "/64"); + URL url = new URL(imgUrl); + + BufferedImage image = ImageIO.read(url); + ImageIcon imageIcon = new ImageIcon(image); +// imageIcon.setImage(imageIcon.getImage().getScaledInstance(table.getRowHeight(), table.getRowHeight(), Image.SCALE_DEFAULT)); + setIcon(imageIcon); + } catch (Exception e) { + e.printStackTrace(); + } + return this; + } +} \ No newline at end of file diff --git a/src/main/java/com/fangxuele/tool/push/ui/dialog/.gitkeep b/src/main/java/com/fangxuele/tool/push/ui/dialog/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/com/fangxuele/tool/push/ui/dialog/UpdateDialog.form b/src/main/java/com/fangxuele/tool/push/ui/dialog/UpdateDialog.form new file mode 100644 index 00000000..50ba0f06 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/dialog/UpdateDialog.form @@ -0,0 +1,88 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/com/fangxuele/tool/push/ui/dialog/UpdateDialog.java b/src/main/java/com/fangxuele/tool/push/ui/dialog/UpdateDialog.java new file mode 100644 index 00000000..4c2033ad --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/dialog/UpdateDialog.java @@ -0,0 +1,198 @@ +package com.fangxuele.tool.push.ui.dialog; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.StreamProgress; +import cn.hutool.core.lang.Console; +import cn.hutool.core.thread.ThreadUtil; +import cn.hutool.http.HttpUtil; +import com.fangxuele.tool.push.App; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.File; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +public class UpdateDialog extends JDialog { + private JPanel contentPane; + private JButton buttonOK; + private JButton buttonCancel; + private JProgressBar progressBarDownload; + private JButton buttonDownloadFromWeb; + private JLabel statusLabel; + private File downLoadFile; + + public UpdateDialog() { + super(App.mainFrame, "下载新版"); + setContentPane(contentPane); + setModal(true); + getRootPane().setDefaultButton(buttonOK); + + buttonOK.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + onOK(); + } + }); + + buttonCancel.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + onCancel(); + } + }); + + // call onCancel() when cross is clicked + setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + onCancel(); + } + }); + + // call onCancel() on ESCAPE + contentPane.registerKeyboardAction(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + onCancel(); + } + }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + buttonDownloadFromWeb.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/rememberber/WePush/releases")); + } catch (IOException | URISyntaxException ex) { + ex.printStackTrace(); + } + } + }); + } + + public void downLoad(String newVersion) { + buttonOK.setEnabled(false); + ThreadUtil.execute( + () -> { + String fileUrl = "http://download.zhoubochina.com/exe/WePush-" + newVersion.replace("v_", "v") + "-x64-Setup.exe"; + String fileName = FileUtil.getName(fileUrl); + URL url; + try { + url = new URL(fileUrl); + HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); + //获取相应的文件长度 + int fileLength = urlConnection.getContentLength(); + progressBarDownload.setMaximum(fileLength); + } catch (IOException e) { + e.printStackTrace(); + } + + File tempDir = new File(FileUtil.getTmpDirPath() + "WePush"); + if (!tempDir.exists()) { + tempDir.mkdirs(); + } + FileUtil.clean(tempDir); + downLoadFile = FileUtil.file(tempDir + File.separator + fileName); + HttpUtil.downloadFile(fileUrl, FileUtil.touch(downLoadFile), new StreamProgress() { + + @Override + public void start() { + statusLabel.setText("开始下载。。。。"); + } + + @Override + public void progress(long progressSize) { + progressBarDownload.setValue((int) progressSize); + statusLabel.setText("已下载:" + FileUtil.readableFileSize(progressSize)); + Console.log("已下载:{}", FileUtil.readableFileSize(progressSize)); + } + + @Override + public void finish() { + statusLabel.setText("下载完成!"); + buttonOK.setEnabled(true); + } + }); + } + ); + } + + private void onOK() { + try { + Desktop.getDesktop().open(downLoadFile); + dispose(); + System.exit(0); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private void onCancel() { + // add your code here if necessary + dispose(); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + contentPane = new JPanel(); + contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1)); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); + panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + buttonOK = new JButton(); + buttonOK.setText("立即安装"); + panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + buttonCancel = new JButton(); + buttonCancel.setText("取消"); + panel2.add(buttonCancel, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + buttonDownloadFromWeb = new JButton(); + buttonDownloadFromWeb.setText("打开下载页面"); + panel2.add(buttonDownloadFromWeb, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, new Dimension(600, 100), null, null, 0, false)); + progressBarDownload = new JProgressBar(); + panel3.add(progressBarDownload, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + statusLabel = new JLabel(); + statusLabel.setText("就绪"); + panel3.add(statusLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return contentPane; + } + +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/AboutForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/AboutForm.form new file mode 100644 index 00000000..c9390e2d --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/AboutForm.form @@ -0,0 +1,86 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/AboutForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/AboutForm.java new file mode 100644 index 00000000..53d2cd70 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/AboutForm.java @@ -0,0 +1,113 @@ +package com.fangxuele.tool.push.ui.form; + +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import lombok.Getter; + +import javax.swing.*; +import java.awt.*; + +/** + *
+ * AboutForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class AboutForm { + private JPanel aboutPanel; + private JLabel sloganLabel; + private JLabel qrCodeLabel; + private JLabel versionLabel; + private JLabel checkUpdateLabel; + private JLabel companyLabel; + private JLabel helpDocLabel; + + public static AboutForm aboutForm = new AboutForm(); + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + aboutPanel = new JPanel(); + aboutPanel.setLayout(new GridLayoutManager(8, 2, new Insets(0, 0, 0, 0), -1, -1)); + sloganLabel = new JLabel(); + sloganLabel.setIcon(new ImageIcon(getClass().getResource("/icon/logo-md.png"))); + sloganLabel.setText(""); + aboutPanel.add(sloganLabel, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setEnabled(true); + Font label1Font = this.$$$getFont$$$(null, -1, 36, label1.getFont()); + if (label1Font != null) label1.setFont(label1Font); + label1.setText("WePush"); + aboutPanel.add(label1, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label2 = new JLabel(); + label2.setText("Proudly by RememBerBer 周波"); + aboutPanel.add(label2, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + qrCodeLabel = new JLabel(); + qrCodeLabel.setIcon(new ImageIcon(getClass().getResource("/icon/weixin-qrcode.png"))); + qrCodeLabel.setText(""); + qrCodeLabel.setToolTipText("感谢您的鼓励和支持!"); + aboutPanel.add(qrCodeLabel, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + versionLabel = new JLabel(); + Font versionLabelFont = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, versionLabel.getFont()); + if (versionLabelFont != null) versionLabel.setFont(versionLabelFont); + versionLabel.setText("版本:v_1.00_170607"); + aboutPanel.add(versionLabel, new GridConstraints(5, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + checkUpdateLabel = new JLabel(); + Font checkUpdateLabelFont = this.$$$getFont$$$(null, Font.BOLD, -1, checkUpdateLabel.getFont()); + if (checkUpdateLabelFont != null) checkUpdateLabel.setFont(checkUpdateLabelFont); + checkUpdateLabel.setText("检查更新"); + aboutPanel.add(checkUpdateLabel, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + companyLabel = new JLabel(); + Font companyLabelFont = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, companyLabel.getFont()); + if (companyLabelFont != null) companyLabel.setFont(companyLabelFont); + companyLabel.setText("Fork me on Gitee: https://gitee.com/zhoubochina/WePush"); + aboutPanel.add(companyLabel, new GridConstraints(7, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + helpDocLabel = new JLabel(); + Font helpDocLabelFont = this.$$$getFont$$$(null, Font.BOLD, -1, helpDocLabel.getFont()); + if (helpDocLabelFont != null) helpDocLabel.setFont(helpDocLabelFont); + helpDocLabel.setText("| 帮助文档"); + aboutPanel.add(helpDocLabel, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return aboutPanel; + } + +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/HelpForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/HelpForm.form new file mode 100644 index 00000000..1a2ca0f9 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/HelpForm.form @@ -0,0 +1,52 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/HelpForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/HelpForm.java new file mode 100644 index 00000000..6137e4d5 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/HelpForm.java @@ -0,0 +1,88 @@ +package com.fangxuele.tool.push.ui.form; + +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import lombok.Getter; + +import javax.swing.*; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.StyleSheet; +import java.awt.*; +import java.io.IOException; + +/** + *
+ * HelpForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class HelpForm { + private JPanel helpPanel; + private JTextPane helpTextPane; + private JLabel labelOnlineHelp; + + public static HelpForm helpForm = new HelpForm(); + + /** + * 初始化使用帮助tab + */ + public static void init() { + + try { + helpForm.getHelpTextPane().setEditable(false); + HTMLEditorKit kit = new HTMLEditorKit(); + helpForm.getHelpTextPane().setEditorKit(kit); + StyleSheet styleSheet = kit.getStyleSheet(); + styleSheet.addRule("h2{color:#FBC87A;}"); + helpForm.getHelpTextPane().setContentType("text/html; charset=utf-8"); + helpForm.getHelpTextPane().setPage(MainWindow.class.getResource("/page/help.html")); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + helpPanel = new JPanel(); + helpPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + final JScrollPane scrollPane1 = new JScrollPane(); + helpPanel.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + helpTextPane = new JTextPane(); + helpTextPane.setDoubleBuffered(true); + helpTextPane.setEditable(false); + helpTextPane.setMargin(new Insets(10, 30, 10, 10)); + helpTextPane.putClientProperty("JEditorPane.honorDisplayProperties", Boolean.TRUE); + helpTextPane.putClientProperty("JEditorPane.w3cLengthUnits", Boolean.TRUE); + scrollPane1.setViewportView(helpTextPane); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 10, 0, 0), -1, -1)); + helpPanel.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + labelOnlineHelp = new JLabel(); + labelOnlineHelp.setText("如有更多问题请添加issue或邮件rememberber@163.com"); + panel1.add(labelOnlineHelp, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return helpPanel; + } +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.form b/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.form index 7f323039..974e6d0b 100644 --- a/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.form +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.form @@ -3,7 +3,7 @@ - + @@ -20,139 +20,38 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + - - + + @@ -162,457 +61,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -623,911 +74,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1538,954 +123,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.java b/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.java index 9bfa9727..00b3cbc8 100644 --- a/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.java +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MainWindow.java @@ -2,11 +2,9 @@ import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; -import com.intellij.uiDesigner.core.Spacer; import lombok.Getter; import javax.swing.*; -import javax.swing.border.TitledBorder; import java.awt.*; /** @@ -19,170 +17,35 @@ */ @Getter public class MainWindow { - public JPanel mainPanel; + private JPanel mainPanel; private JTabbedPane tabbedPane; private JPanel aboutPanel; private JSplitPane messagePanel; private JPanel memberPanel; private JPanel pushPanel; - private JPanel helpPanel; private JPanel settingPanel; - private JLabel companyLabel; - private JLabel versionLabel; - private JComboBox msgTypeComboBox; - private JLabel msgTypeLabel; - private JPanel templateMsgPanel; - private JPanel kefuMsgPanel; - private JTextField previewUserField; - private JButton previewMsgButton; - private JLabel previewMemberLabel; - private JTextField msgTemplateIdTextField; - private JTextField msgTemplateUrlTextField; - private JPanel templateMsgDataPanel; - private JLabel templateIdLabel; - private JLabel templateUrlLabel; - private JTextField templateDataNameTextField; - private JTextField templateDataValueTextField; - private JTextField templateDataColorTextField; - private JButton templateMsgDataAddButton; - private JTable templateMsgDataTable; - private JLabel templateMsgNameLabel; - private JLabel templateMsgValueLabel; - private JLabel templateMsgColorLabel; - private JComboBox msgKefuMsgTypeComboBox; - private JTextField msgKefuMsgTitleTextField; - private JTextField msgKefuPicUrlTextField; - private JTextField msgKefuDescTextField; - private JTextField msgKefuUrlTextField; - private JLabel kefuMsgTypeLabel; - private JLabel kefuMsgTitleLabel; - private JLabel kefuMsgPicUrlLabel; - private JLabel kefuMsgDescLabel; - private JLabel kefuMsgUrlLabel; - private JProgressBar memberTabImportProgressBar; - private JTextArea importFromSqlTextArea; - private JButton importFromSqlButton; - private JTextField memberFilePathField; - private JButton importFromFileButton; - private JPanel memberTabUpPanel; - private JPanel memberTabDownPanel; - private JPanel memberTabCenterPanel; - private JLabel memberTabCountLabel; - private JLabel memberTabImportProgressLabel; - private JLabel importFromFileLabel; - private JProgressBar pushTotalProgressBar; - private JTextField pushPageSizeTextField; - private JTextField pushPagePerThreadTextField; - private JTextArea pushConsoleTextArea; - private JTable pushThreadTable; - private JButton ScheduleRunButton; - private JLabel pushSuccessCount; - private JLabel pushFailCount; - private JButton pushStopButton; - private JButton pushStartButton; - private JTextField msgNameField; - private JButton msgSaveButton; - private JLabel msgNameLabel; - private JPanel pushUpPanel; - private JPanel pushDownPanel; - private JPanel pushCenterPanel; - private JPanel pushControlPanel; - private JLabel pushTotalCountLabel; - private JLabel pushTotalPageLabel; - private JLabel pushTotalThreadLabel; - private JLabel pushTotalProgressLabel; - private JRadioButton runAtThisTimeRadioButton; - private JTextField startAtThisTimeTextField; private JPanel schedulePanel; - private JRadioButton runPerDayRadioButton; - private JTextField startPerDayTextField; - private JRadioButton runPerWeekRadioButton; - private JButton scheduleSaveButton; - private JComboBox schedulePerWeekComboBox; - private JTextField startPerWeekTextField; - private JTextField wechatAppIdTextField; - private JPasswordField wechatAppSecretPasswordField; - private JPasswordField wechatTokenPasswordField; - private JPasswordField wechatAesKeyPasswordField; - private JButton settingMpInfoSaveButton; - private JTextField aliServerUrlTextField; - private JPasswordField aliAppKeyPasswordField; - private JTextField aliSignTextField; - private JButton settingAliInfoSaveButton; - private JTextField mysqlUrlTextField; - private JTextField mysqlDatabaseTextField; - private JTextField mysqlUserTextField; - private JPasswordField mysqlPasswordField; - private JButton settingTestDbLinkButton; - private JButton settingDbInfoSaveButton; - private JTable msgHistable; - private JCheckBox dryRunCheckBox; - private JLabel sloganLabel; - private JLabel checkUpdateLabel; - private JButton createMsgButton; - private JButton memberImportAllButton; - private JComboBox settingThemeComboBox; - private JComboBox settingFontNameComboBox; - private JComboBox settingFontSizeComboBox; - private JButton settingAppearanceSaveButton; - private JLabel pushLastTimeLabel; - private JLabel pushLeftTimeLabel; - private JLabel pushMsgName; - private JScrollPane settingScrollPane; - private JPasswordField aliAppSecretPasswordField; - private JButton clearImportButton; - private JComboBox memberHisComboBox; - private JButton importFromHisButton; - private JButton msgHisTableSelectAllButton; - private JButton msgHisTableDeleteButton; - private JLabel scheduleDetailLabel; - private JTextField msgTemplateMiniAppidTextField; - private JTextField msgTemplateMiniPagePathTextField; - private JLabel templateMiniProgramAppidLabel; - private JLabel templateMiniProgramPagePathLabel; - private JTextPane helpTextPane; - private JLabel labelOnlineHelp; - private JLabel templateMiniProgramOptionalLabel1; - private JLabel templateMiniProgramOptionalLabel2; - private JCheckBox autoCheckUpdateCheckBox; - private JButton pushHisLeftSelectAllButton; - private JButton pushHisLeftDeleteButton; - private JTable pushHisLeftTable; private JPanel pushHisPanel; - private JButton pushHisExportButton; - private JTextArea pushHisTextArea; - private JLabel pushHisCountLabel; - private JButton pushHisCopyButton; - private JButton memberImportTagButton; - private JComboBox memberImportTagComboBox; - private JButton memberImportTagFreshButton; - private JButton memberImportExploreButton; - private JTextField aliyunAccessKeyIdTextField; - private JPasswordField aliyunAccessKeySecretTextField; - private JTextField aliyunSignTextField; - private JButton settingAliyunSaveButton; - private JButton memberImportTagRetainButton; - private JTextField miniAppAppIdTextField; - private JPasswordField miniAppAppSecretPasswordField; - private JPasswordField miniAppTokenPasswordField; - private JPasswordField miniAppAesKeyPasswordField; - private JButton settingMaInfoSaveButton; - private JTextField msgTemplateKeyWordTextField; - private JLabel templateKeyWordLabel; - private JPanel userCaseListPanel; - private JScrollPane userCaseScrollPane; - private JTextField txyunAppIdTextField; - private JPasswordField txyunAppKeyTextField; - private JTextField txyunSignTextField; - private JButton settingTxyunSaveButton; - private JPasswordField yunpianApiKeyTextField; - private JButton settingYunpianSaveButton; - private JTextArea msgYunpianMsgContentTextField; - private JPanel yunpianMsgPanel; - private JLabel qrCodeLabel; + private JPanel userCasePanel; + private JPanel messageEditPanel; + private JPanel messageManagePanel; + private JPanel messageTypePanel; public static MainWindow mainWindow = new MainWindow(); + public void init() { + mainWindow.getAboutPanel().add(AboutForm.aboutForm.getAboutPanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getUserCasePanel().add(UserCaseForm.userCaseForm.getUserCasePanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getSchedulePanel().add(ScheduleForm.scheduleForm.getSchedulePanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getPushHisPanel().add(PushHisForm.pushHisForm.getPushHisPanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getSettingPanel().add(SettingForm.settingForm.getSettingPanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getMessageEditPanel().add(MessageEditForm.messageEditForm.getMessageEditPanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getMessageManagePanel().add(MessageManageForm.messageManageForm.getMessageManagePanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getMemberPanel().add(MemberForm.memberForm.getMemberPanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getPushPanel().add(PushForm.pushForm.getPushPanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + mainWindow.getMessageTypePanel().add(MessageTypeForm.messageTypeForm.getMessageTypePanel(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + } + { // GUI initializer generated by IntelliJ IDEA GUI Designer // >>> IMPORTANT!! <<< @@ -206,950 +69,49 @@ public class MainWindow { if (tabbedPaneFont != null) tabbedPane.setFont(tabbedPaneFont); mainPanel.add(tabbedPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); aboutPanel = new JPanel(); - aboutPanel.setLayout(new GridLayoutManager(8, 6, new Insets(10, 10, 10, 10), -1, -1)); + aboutPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1)); tabbedPane.addTab("关于", aboutPanel); - sloganLabel = new JLabel(); - sloganLabel.setIcon(new ImageIcon(getClass().getResource("/icon/logo-md.png"))); - sloganLabel.setText(""); - aboutPanel.add(sloganLabel, new GridConstraints(0, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label1 = new JLabel(); - label1.setEnabled(true); - Font label1Font = this.$$$getFont$$$(null, -1, 36, label1.getFont()); - if (label1Font != null) label1.setFont(label1Font); - label1.setText("WePush"); - aboutPanel.add(label1, new GridConstraints(1, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label2 = new JLabel(); - label2.setText("Proudly by 周波"); - aboutPanel.add(label2, new GridConstraints(2, 0, 2, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - versionLabel = new JLabel(); - Font versionLabelFont = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, versionLabel.getFont()); - if (versionLabelFont != null) versionLabel.setFont(versionLabelFont); - versionLabel.setText("版本:v_1.00_170607"); - aboutPanel.add(versionLabel, new GridConstraints(5, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - companyLabel = new JLabel(); - Font companyLabelFont = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, companyLabel.getFont()); - if (companyLabelFont != null) companyLabel.setFont(companyLabelFont); - companyLabel.setText("Fork me on Gitee: https://gitee.com/zhoubochina/WePush"); - aboutPanel.add(companyLabel, new GridConstraints(7, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - checkUpdateLabel = new JLabel(); - Font checkUpdateLabelFont = this.$$$getFont$$$(null, Font.BOLD, -1, checkUpdateLabel.getFont()); - if (checkUpdateLabelFont != null) checkUpdateLabel.setFont(checkUpdateLabelFont); - checkUpdateLabel.setText("检查更新"); - aboutPanel.add(checkUpdateLabel, new GridConstraints(6, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - qrCodeLabel = new JLabel(); - qrCodeLabel.setIcon(new ImageIcon(getClass().getResource("/icon/weixin-qrcode.png"))); - qrCodeLabel.setText(""); - aboutPanel.add(qrCodeLabel, new GridConstraints(4, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - helpPanel = new JPanel(); - helpPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 10, 0), -1, -1)); - tabbedPane.addTab("使用帮助", helpPanel); - final JScrollPane scrollPane1 = new JScrollPane(); - helpPanel.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - helpTextPane = new JTextPane(); - helpTextPane.setDoubleBuffered(true); - helpTextPane.setEditable(false); - helpTextPane.setMargin(new Insets(10, 30, 10, 10)); - helpTextPane.putClientProperty("JEditorPane.honorDisplayProperties", Boolean.TRUE); - helpTextPane.putClientProperty("JEditorPane.w3cLengthUnits", Boolean.TRUE); - scrollPane1.setViewportView(helpTextPane); - final JPanel panel1 = new JPanel(); - panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 10, 0, 0), -1, -1)); - helpPanel.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - labelOnlineHelp = new JLabel(); - labelOnlineHelp.setText("如有更多问题请添加issue或邮件rememberber@163.com"); - panel1.add(labelOnlineHelp, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + messageTypePanel = new JPanel(); + messageTypePanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + tabbedPane.addTab("①选择消息类型", messageTypePanel); messagePanel = new JSplitPane(); + messagePanel.setContinuousLayout(true); + messagePanel.setDividerLocation(500); + messagePanel.setDividerSize(4); messagePanel.setDoubleBuffered(true); - tabbedPane.addTab("编辑消息", messagePanel); - final JPanel panel2 = new JPanel(); - panel2.setLayout(new GridLayoutManager(4, 5, new Insets(10, 8, 0, 8), -1, -1)); - panel2.setMaximumSize(new Dimension(-1, -1)); - panel2.setMinimumSize(new Dimension(-1, -1)); - panel2.setPreferredSize(new Dimension(-1, -1)); - messagePanel.setRightComponent(panel2); - final JPanel panel3 = new JPanel(); - panel3.setLayout(new GridLayoutManager(1, 7, new Insets(0, 0, 10, 0), -1, -1)); - panel2.add(panel3, new GridConstraints(0, 0, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - msgTypeLabel = new JLabel(); - Font msgTypeLabelFont = this.$$$getFont$$$(null, Font.BOLD, -1, msgTypeLabel.getFont()); - if (msgTypeLabelFont != null) msgTypeLabel.setFont(msgTypeLabelFont); - msgTypeLabel.setText("消息类型"); - panel3.add(msgTypeLabel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgTypeComboBox = new JComboBox(); - final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel(); - defaultComboBoxModel1.addElement("模板消息"); - defaultComboBoxModel1.addElement("模板消息-小程序"); - defaultComboBoxModel1.addElement("客服消息"); - defaultComboBoxModel1.addElement("客服消息优先"); - defaultComboBoxModel1.addElement("阿里云短信"); - defaultComboBoxModel1.addElement("阿里大于模板短信"); - defaultComboBoxModel1.addElement("腾讯云短信"); - defaultComboBoxModel1.addElement("云片网短信"); - msgTypeComboBox.setModel(defaultComboBoxModel1); - panel3.add(msgTypeComboBox, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgNameLabel = new JLabel(); - Font msgNameLabelFont = this.$$$getFont$$$(null, Font.BOLD, -1, msgNameLabel.getFont()); - if (msgNameLabelFont != null) msgNameLabel.setFont(msgNameLabelFont); - msgNameLabel.setText("推送任务名称"); - panel3.add(msgNameLabel, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgNameField = new JTextField(); - panel3.add(msgNameField, new GridConstraints(0, 4, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - createMsgButton = new JButton(); - createMsgButton.setText("新建消息"); - panel3.add(createMsgButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JPanel panel4 = new JPanel(); - panel4.setLayout(new GridLayoutManager(1, 5, new Insets(0, 10, 0, 0), -1, -1)); - panel2.add(panel4, new GridConstraints(3, 0, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - previewMemberLabel = new JLabel(); - previewMemberLabel.setText("预览用户openid/手机号(以半角分号分隔)"); - panel4.add(previewMemberLabel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - previewUserField = new JTextField(); - panel4.add(previewUserField, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - previewMsgButton = new JButton(); - previewMsgButton.setText("预览"); - panel4.add(previewMsgButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgSaveButton = new JButton(); - msgSaveButton.setText("保存"); - panel4.add(msgSaveButton, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - templateMsgPanel = new JPanel(); - templateMsgPanel.setLayout(new GridLayoutManager(6, 3, new Insets(10, 10, 0, 0), -1, -1)); - panel2.add(templateMsgPanel, new GridConstraints(1, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - templateMsgPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "模板消息编辑", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, templateMsgPanel.getFont()))); - templateIdLabel = new JLabel(); - templateIdLabel.setText("模板ID"); - templateMsgPanel.add(templateIdLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgTemplateIdTextField = new JTextField(); - templateMsgPanel.add(msgTemplateIdTextField, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - templateUrlLabel = new JLabel(); - templateUrlLabel.setText("跳转URL"); - templateMsgPanel.add(templateUrlLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgTemplateUrlTextField = new JTextField(); - templateMsgPanel.add(msgTemplateUrlTextField, new GridConstraints(1, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - templateMsgDataPanel = new JPanel(); - templateMsgDataPanel.setLayout(new GridLayoutManager(2, 7, new Insets(10, 0, 0, 0), -1, -1)); - templateMsgPanel.add(templateMsgDataPanel, new GridConstraints(5, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - templateMsgDataPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "模板变量(可使用\"$ENTER$\"作为换行符)", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.ABOVE_TOP)); - templateMsgNameLabel = new JLabel(); - templateMsgNameLabel.setText("name"); - templateMsgDataPanel.add(templateMsgNameLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - templateDataNameTextField = new JTextField(); - templateMsgDataPanel.add(templateDataNameTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - templateMsgValueLabel = new JLabel(); - templateMsgValueLabel.setText("value"); - templateMsgDataPanel.add(templateMsgValueLabel, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - templateDataValueTextField = new JTextField(); - templateMsgDataPanel.add(templateDataValueTextField, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - templateMsgColorLabel = new JLabel(); - templateMsgColorLabel.setText("color"); - templateMsgDataPanel.add(templateMsgColorLabel, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - templateDataColorTextField = new JTextField(); - templateMsgDataPanel.add(templateDataColorTextField, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - templateMsgDataAddButton = new JButton(); - templateMsgDataAddButton.setIcon(new ImageIcon(getClass().getResource("/icon/add.png"))); - templateMsgDataAddButton.setText("添加"); - templateMsgDataPanel.add(templateMsgDataAddButton, new GridConstraints(0, 6, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JScrollPane scrollPane2 = new JScrollPane(); - templateMsgDataPanel.add(scrollPane2, new GridConstraints(1, 0, 1, 7, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - templateMsgDataTable = new JTable(); - templateMsgDataTable.setAutoCreateColumnsFromModel(true); - templateMsgDataTable.setAutoCreateRowSorter(true); - templateMsgDataTable.setGridColor(new Color(-12236470)); - templateMsgDataTable.setRowHeight(40); - scrollPane2.setViewportView(templateMsgDataTable); - templateMiniProgramAppidLabel = new JLabel(); - templateMiniProgramAppidLabel.setText("小程序appid"); - templateMsgPanel.add(templateMiniProgramAppidLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgTemplateMiniAppidTextField = new JTextField(); - msgTemplateMiniAppidTextField.setText(""); - templateMsgPanel.add(msgTemplateMiniAppidTextField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - templateMiniProgramPagePathLabel = new JLabel(); - templateMiniProgramPagePathLabel.setText("小程序页面路径"); - templateMsgPanel.add(templateMiniProgramPagePathLabel, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgTemplateMiniPagePathTextField = new JTextField(); - msgTemplateMiniPagePathTextField.setText(""); - templateMsgPanel.add(msgTemplateMiniPagePathTextField, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - templateMiniProgramOptionalLabel1 = new JLabel(); - templateMiniProgramOptionalLabel1.setText("(选填)"); - templateMsgPanel.add(templateMiniProgramOptionalLabel1, new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - templateMiniProgramOptionalLabel2 = new JLabel(); - templateMiniProgramOptionalLabel2.setText("(选填)"); - templateMsgPanel.add(templateMiniProgramOptionalLabel2, new GridConstraints(4, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - templateKeyWordLabel = new JLabel(); - templateKeyWordLabel.setText("放大关键词"); - templateMsgPanel.add(templateKeyWordLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgTemplateKeyWordTextField = new JTextField(); - templateMsgPanel.add(msgTemplateKeyWordTextField, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - kefuMsgPanel = new JPanel(); - kefuMsgPanel.setLayout(new GridLayoutManager(6, 2, new Insets(10, 0, 0, 0), -1, -1)); - panel2.add(kefuMsgPanel, new GridConstraints(1, 2, 2, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - kefuMsgPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "客服消息编辑", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, kefuMsgPanel.getFont()))); - kefuMsgTypeLabel = new JLabel(); - kefuMsgTypeLabel.setText("消息类型"); - kefuMsgPanel.add(kefuMsgTypeLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer1 = new Spacer(); - kefuMsgPanel.add(spacer1, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - msgKefuMsgTypeComboBox = new JComboBox(); - final DefaultComboBoxModel defaultComboBoxModel2 = new DefaultComboBoxModel(); - defaultComboBoxModel2.addElement("文本消息"); - defaultComboBoxModel2.addElement("图文消息"); - msgKefuMsgTypeComboBox.setModel(defaultComboBoxModel2); - kefuMsgPanel.add(msgKefuMsgTypeComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - kefuMsgTitleLabel = new JLabel(); - kefuMsgTitleLabel.setText("内容/标题"); - kefuMsgPanel.add(kefuMsgTitleLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgKefuMsgTitleTextField = new JTextField(); - kefuMsgPanel.add(msgKefuMsgTitleTextField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, new Dimension(380, -1), new Dimension(380, -1), null, 0, false)); - kefuMsgPicUrlLabel = new JLabel(); - kefuMsgPicUrlLabel.setText("图片URL"); - kefuMsgPanel.add(kefuMsgPicUrlLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgKefuPicUrlTextField = new JTextField(); - kefuMsgPanel.add(msgKefuPicUrlTextField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - kefuMsgDescLabel = new JLabel(); - kefuMsgDescLabel.setText("描述"); - kefuMsgPanel.add(kefuMsgDescLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgKefuDescTextField = new JTextField(); - kefuMsgPanel.add(msgKefuDescTextField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - kefuMsgUrlLabel = new JLabel(); - kefuMsgUrlLabel.setText("跳转URL"); - kefuMsgPanel.add(kefuMsgUrlLabel, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgKefuUrlTextField = new JTextField(); - kefuMsgPanel.add(msgKefuUrlTextField, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final Spacer spacer2 = new Spacer(); - panel2.add(spacer2, new GridConstraints(1, 1, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - yunpianMsgPanel = new JPanel(); - yunpianMsgPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 0, 0, 0), -1, -1)); - panel2.add(yunpianMsgPanel, new GridConstraints(1, 4, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - yunpianMsgPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "云片网短信编辑", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, yunpianMsgPanel.getFont()))); - final JScrollPane scrollPane3 = new JScrollPane(); - yunpianMsgPanel.add(scrollPane3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - msgYunpianMsgContentTextField = new JTextArea(); - scrollPane3.setViewportView(msgYunpianMsgContentTextField); - final JPanel panel5 = new JPanel(); - panel5.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); - panel5.setMaximumSize(new Dimension(-1, -1)); - panel5.setMinimumSize(new Dimension(-1, -1)); - panel5.setPreferredSize(new Dimension(280, -1)); - messagePanel.setLeftComponent(panel5); - final JScrollPane scrollPane4 = new JScrollPane(); - panel5.add(scrollPane4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - msgHistable = new JTable(); - msgHistable.setGridColor(new Color(-12236470)); - msgHistable.setRowHeight(40); - scrollPane4.setViewportView(msgHistable); - final JPanel panel6 = new JPanel(); - panel6.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); - panel5.add(panel6, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - msgHisTableSelectAllButton = new JButton(); - msgHisTableSelectAllButton.setText("全选"); - panel6.add(msgHisTableSelectAllButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgHisTableDeleteButton = new JButton(); - msgHisTableDeleteButton.setText("删除"); - panel6.add(msgHisTableDeleteButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer3 = new Spacer(); - panel6.add(spacer3, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + tabbedPane.addTab("②编辑消息", messagePanel); + messageEditPanel = new JPanel(); + messageEditPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + messageEditPanel.setMaximumSize(new Dimension(-1, -1)); + messageEditPanel.setMinimumSize(new Dimension(-1, -1)); + messageEditPanel.setPreferredSize(new Dimension(-1, -1)); + messagePanel.setRightComponent(messageEditPanel); + messageManagePanel = new JPanel(); + messageManagePanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + messageManagePanel.setMaximumSize(new Dimension(-1, -1)); + messageManagePanel.setMinimumSize(new Dimension(-1, -1)); + messageManagePanel.setPreferredSize(new Dimension(280, -1)); + messagePanel.setLeftComponent(messageManagePanel); memberPanel = new JPanel(); - memberPanel.setLayout(new GridLayoutManager(8, 1, new Insets(10, 10, 10, 10), -1, -1)); - tabbedPane.addTab("准备目标用户", memberPanel); - memberTabUpPanel = new JPanel(); - memberTabUpPanel.setLayout(new GridLayoutManager(6, 6, new Insets(0, 0, 0, 0), -1, -1)); - memberPanel.add(memberTabUpPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - memberTabCountLabel = new JLabel(); - Font memberTabCountLabelFont = this.$$$getFont$$$("Microsoft JhengHei UI", -1, 36, memberTabCountLabel.getFont()); - if (memberTabCountLabelFont != null) memberTabCountLabel.setFont(memberTabCountLabelFont); - memberTabCountLabel.setForeground(new Color(-276358)); - memberTabCountLabel.setText("0"); - memberTabUpPanel.add(memberTabCountLabel, new GridConstraints(0, 0, 4, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberTabImportProgressLabel = new JLabel(); - memberTabImportProgressLabel.setText("导入进度"); - memberTabUpPanel.add(memberTabImportProgressLabel, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberTabImportProgressBar = new JProgressBar(); - memberTabUpPanel.add(memberTabImportProgressBar, new GridConstraints(4, 1, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer4 = new Spacer(); - memberTabUpPanel.add(spacer4, new GridConstraints(0, 5, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final JLabel label3 = new JLabel(); - label3.setText("已导入"); - memberTabUpPanel.add(label3, new GridConstraints(0, 3, 4, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JSeparator separator1 = new JSeparator(); - memberTabUpPanel.add(separator1, new GridConstraints(5, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - clearImportButton = new JButton(); - clearImportButton.setText("清除"); - memberTabUpPanel.add(clearImportButton, new GridConstraints(2, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberTabDownPanel = new JPanel(); - memberTabDownPanel.setLayout(new GridLayoutManager(1, 4, new Insets(10, 5, 10, 0), -1, -1)); - memberPanel.add(memberTabDownPanel, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - memberTabDownPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "通过文件导入", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, memberTabDownPanel.getFont()))); - importFromFileLabel = new JLabel(); - importFromFileLabel.setHorizontalAlignment(11); - importFromFileLabel.setHorizontalTextPosition(4); - importFromFileLabel.setText("文件路径(*.txt,*.csv,*.xlsx)"); - memberTabDownPanel.add(importFromFileLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberFilePathField = new JTextField(); - memberTabDownPanel.add(memberFilePathField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - importFromFileButton = new JButton(); - importFromFileButton.setIcon(new ImageIcon(getClass().getResource("/icon/fromVCS.png"))); - importFromFileButton.setText("导入openid/手机号"); - memberTabDownPanel.add(importFromFileButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberImportExploreButton = new JButton(); - memberImportExploreButton.setText("浏览"); - memberTabDownPanel.add(memberImportExploreButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberTabCenterPanel = new JPanel(); - memberTabCenterPanel.setLayout(new GridLayoutManager(2, 2, new Insets(10, 5, 0, 0), -1, -1)); - memberPanel.add(memberTabCenterPanel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - memberTabCenterPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "通过SQL导入", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, memberTabCenterPanel.getFont()))); - importFromSqlTextArea = new JTextArea(); - importFromSqlTextArea.setText("SELECT openid FROM"); - memberTabCenterPanel.add(importFromSqlTextArea, new GridConstraints(0, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 150), null, 0, false)); - importFromSqlButton = new JButton(); - importFromSqlButton.setIcon(new ImageIcon(getClass().getResource("/icon/fromVCS.png"))); - importFromSqlButton.setText("导入openid/手机号"); - memberTabCenterPanel.add(importFromSqlButton, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer5 = new Spacer(); - memberTabCenterPanel.add(spacer5, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final Spacer spacer6 = new Spacer(); - memberPanel.add(spacer6, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final Spacer spacer7 = new Spacer(); - memberPanel.add(spacer7, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JPanel panel7 = new JPanel(); - panel7.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1)); - memberPanel.add(panel7, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - final JLabel label4 = new JLabel(); - Font label4Font = this.$$$getFont$$$(null, Font.BOLD, -1, label4.getFont()); - if (label4Font != null) label4.setFont(label4Font); - label4.setText("从历史导入"); - panel7.add(label4, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberHisComboBox = new JComboBox(); - panel7.add(memberHisComboBox, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - importFromHisButton = new JButton(); - importFromHisButton.setIcon(new ImageIcon(getClass().getResource("/icon/fromVCS.png"))); - importFromHisButton.setText("导入openid/手机号"); - panel7.add(importFromHisButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JSeparator separator2 = new JSeparator(); - memberPanel.add(separator2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JPanel panel8 = new JPanel(); - panel8.setLayout(new GridLayoutManager(2, 6, new Insets(0, 5, 0, 0), -1, -1)); - memberPanel.add(panel8, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel8.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "通过微信公众平台导入", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel8.getFont()))); - memberImportTagButton = new JButton(); - Font memberImportTagButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportTagButton.getFont()); - if (memberImportTagButtonFont != null) memberImportTagButton.setFont(memberImportTagButtonFont); - memberImportTagButton.setIcon(new ImageIcon(getClass().getResource("/icon/fromVCS.png"))); - memberImportTagButton.setText("导入选择的标签-取并集"); - panel8.add(memberImportTagButton, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label5 = new JLabel(); - Font label5Font = this.$$$getFont$$$(null, Font.PLAIN, -1, label5.getFont()); - if (label5Font != null) label5.setFont(label5Font); - label5.setText("按标签导入"); - panel8.add(label5, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberImportTagComboBox = new JComboBox(); - final DefaultComboBoxModel defaultComboBoxModel3 = new DefaultComboBoxModel(); - memberImportTagComboBox.setModel(defaultComboBoxModel3); - panel8.add(memberImportTagComboBox, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberImportTagFreshButton = new JButton(); - Font memberImportTagFreshButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportTagFreshButton.getFont()); - if (memberImportTagFreshButtonFont != null) memberImportTagFreshButton.setFont(memberImportTagFreshButtonFont); - memberImportTagFreshButton.setIcon(new ImageIcon(getClass().getResource("/icon/refresh.png"))); - memberImportTagFreshButton.setText("刷新可选的标签"); - panel8.add(memberImportTagFreshButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberImportTagRetainButton = new JButton(); - Font memberImportTagRetainButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportTagRetainButton.getFont()); - if (memberImportTagRetainButtonFont != null) - memberImportTagRetainButton.setFont(memberImportTagRetainButtonFont); - memberImportTagRetainButton.setIcon(new ImageIcon(getClass().getResource("/icon/fromVCS.png"))); - memberImportTagRetainButton.setText("导入选择的标签-取交集"); - panel8.add(memberImportTagRetainButton, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - memberImportAllButton = new JButton(); - Font memberImportAllButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportAllButton.getFont()); - if (memberImportAllButtonFont != null) memberImportAllButton.setFont(memberImportAllButtonFont); - memberImportAllButton.setIcon(new ImageIcon(getClass().getResource("/icon/fromVCS.png"))); - memberImportAllButton.setText("导入全员(导入所有关注公众号的用户)"); - panel8.add(memberImportAllButton, new GridConstraints(1, 1, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + tabbedPane.addTab("③准备目标用户", memberPanel); pushPanel = new JPanel(); - pushPanel.setLayout(new GridLayoutManager(3, 1, new Insets(10, 10, 10, 10), -1, -1)); - tabbedPane.addTab("开始推送", pushPanel); - pushUpPanel = new JPanel(); - pushUpPanel.setLayout(new GridLayoutManager(7, 13, new Insets(0, 0, 0, 0), -1, -1)); - pushPanel.add(pushUpPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - pushSuccessCount = new JLabel(); - Font pushSuccessCountFont = this.$$$getFont$$$("Microsoft JhengHei UI", -1, 48, pushSuccessCount.getFont()); - if (pushSuccessCountFont != null) pushSuccessCount.setFont(pushSuccessCountFont); - pushSuccessCount.setForeground(new Color(-13587376)); - pushSuccessCount.setText("0"); - pushUpPanel.add(pushSuccessCount, new GridConstraints(0, 0, 6, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushFailCount = new JLabel(); - Font pushFailCountFont = this.$$$getFont$$$("Microsoft YaHei UI", -1, 48, pushFailCount.getFont()); - if (pushFailCountFont != null) pushFailCount.setFont(pushFailCountFont); - pushFailCount.setForeground(new Color(-2200483)); - pushFailCount.setText("0"); - pushUpPanel.add(pushFailCount, new GridConstraints(0, 2, 6, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushTotalProgressLabel = new JLabel(); - pushTotalProgressLabel.setText("总进度"); - pushUpPanel.add(pushTotalProgressLabel, new GridConstraints(5, 8, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushTotalProgressBar = new JProgressBar(); - pushTotalProgressBar.setStringPainted(true); - pushUpPanel.add(pushTotalProgressBar, new GridConstraints(5, 9, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label6 = new JLabel(); - label6.setText("成功"); - pushUpPanel.add(label6, new GridConstraints(2, 1, 2, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label7 = new JLabel(); - label7.setText("失败"); - pushUpPanel.add(label7, new GridConstraints(2, 3, 2, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JSeparator separator3 = new JSeparator(); - separator3.setOrientation(1); - pushUpPanel.add(separator3, new GridConstraints(0, 4, 6, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - pushLastTimeLabel = new JLabel(); - pushLastTimeLabel.setEnabled(true); - Font pushLastTimeLabelFont = this.$$$getFont$$$(null, -1, 36, pushLastTimeLabel.getFont()); - if (pushLastTimeLabelFont != null) pushLastTimeLabel.setFont(pushLastTimeLabelFont); - pushLastTimeLabel.setForeground(new Color(-6710887)); - pushLastTimeLabel.setText("0s"); - pushUpPanel.add(pushLastTimeLabel, new GridConstraints(0, 6, 3, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label8 = new JLabel(); - label8.setText("耗时"); - pushUpPanel.add(label8, new GridConstraints(1, 5, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushLeftTimeLabel = new JLabel(); - Font pushLeftTimeLabelFont = this.$$$getFont$$$(null, -1, 36, pushLeftTimeLabel.getFont()); - if (pushLeftTimeLabelFont != null) pushLeftTimeLabel.setFont(pushLeftTimeLabelFont); - pushLeftTimeLabel.setForeground(new Color(-6710887)); - pushLeftTimeLabel.setText("0s"); - pushUpPanel.add(pushLeftTimeLabel, new GridConstraints(3, 6, 3, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JSeparator separator4 = new JSeparator(); - separator4.setOrientation(1); - pushUpPanel.add(separator4, new GridConstraints(0, 7, 6, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - pushTotalThreadLabel = new JLabel(); - pushTotalThreadLabel.setText("需要线程宝宝个数:"); - pushUpPanel.add(pushTotalThreadLabel, new GridConstraints(3, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushTotalPageLabel = new JLabel(); - pushTotalPageLabel.setText("总页数:"); - pushUpPanel.add(pushTotalPageLabel, new GridConstraints(2, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushTotalCountLabel = new JLabel(); - pushTotalCountLabel.setText("总用户数:"); - pushUpPanel.add(pushTotalCountLabel, new GridConstraints(1, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushMsgName = new JLabel(); - Font pushMsgNameFont = this.$$$getFont$$$(null, -1, 24, pushMsgName.getFont()); - if (pushMsgNameFont != null) pushMsgName.setFont(pushMsgNameFont); - pushMsgName.setForeground(new Color(-13587376)); - pushMsgName.setText("五彩城跳跳糖大蹦床定点推送"); - pushUpPanel.add(pushMsgName, new GridConstraints(0, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label9 = new JLabel(); - label9.setText("预计剩余"); - pushUpPanel.add(label9, new GridConstraints(4, 5, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - scheduleDetailLabel = new JLabel(); - scheduleDetailLabel.setForeground(new Color(-276358)); - scheduleDetailLabel.setText(""); - pushUpPanel.add(scheduleDetailLabel, new GridConstraints(4, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushDownPanel = new JPanel(); - pushDownPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); - pushPanel.add(pushDownPanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - pushControlPanel = new JPanel(); - pushControlPanel.setLayout(new GridLayoutManager(1, 9, new Insets(0, 0, 0, 0), -1, -1)); - pushDownPanel.add(pushControlPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - final JLabel label10 = new JLabel(); - label10.setText("每页分配用户数"); - pushControlPanel.add(label10, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushPageSizeTextField = new JTextField(); - pushControlPanel.add(pushPageSizeTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(100, -1), null, 0, false)); - final JLabel label11 = new JLabel(); - label11.setText("每个线程分配的页数"); - pushControlPanel.add(label11, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushPagePerThreadTextField = new JTextField(); - pushControlPanel.add(pushPagePerThreadTextField, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(100, -1), null, 0, false)); - ScheduleRunButton = new JButton(); - ScheduleRunButton.setIcon(new ImageIcon(getClass().getResource("/icon/clock.png"))); - ScheduleRunButton.setText("按计划执行"); - pushControlPanel.add(ScheduleRunButton, new GridConstraints(0, 6, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushStopButton = new JButton(); - pushStopButton.setEnabled(false); - pushStopButton.setIcon(new ImageIcon(getClass().getResource("/icon/suspend.png"))); - pushStopButton.setText("停止"); - pushControlPanel.add(pushStopButton, new GridConstraints(0, 7, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushStartButton = new JButton(); - pushStartButton.setIcon(new ImageIcon(getClass().getResource("/icon/run@2x.png"))); - pushStartButton.setText("开始"); - pushControlPanel.add(pushStartButton, new GridConstraints(0, 8, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - dryRunCheckBox = new JCheckBox(); - dryRunCheckBox.setText("空跑"); - pushControlPanel.add(dryRunCheckBox, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer8 = new Spacer(); - pushControlPanel.add(spacer8, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - pushCenterPanel = new JPanel(); - pushCenterPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); - pushPanel.add(pushCenterPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - final JScrollPane scrollPane5 = new JScrollPane(); - pushCenterPanel.add(scrollPane5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - pushConsoleTextArea = new JTextArea(); - scrollPane5.setViewportView(pushConsoleTextArea); - final JScrollPane scrollPane6 = new JScrollPane(); - pushCenterPanel.add(scrollPane6, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - pushThreadTable = new JTable(); - pushThreadTable.setGridColor(new Color(-12236470)); - pushThreadTable.setRowHeight(40); - scrollPane6.setViewportView(pushThreadTable); - schedulePanel = new JPanel(); - schedulePanel.setLayout(new GridLayoutManager(5, 7, new Insets(10, 10, 10, 10), -1, -1)); - tabbedPane.addTab("计划任务", schedulePanel); - runAtThisTimeRadioButton = new JRadioButton(); - runAtThisTimeRadioButton.setText("在此时间开始推送:"); - schedulePanel.add(runAtThisTimeRadioButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer9 = new Spacer(); - schedulePanel.add(spacer9, new GridConstraints(0, 6, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer10 = new Spacer(); - schedulePanel.add(spacer10, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - startAtThisTimeTextField = new JTextField(); - startAtThisTimeTextField.setText(""); - schedulePanel.add(startAtThisTimeTextField, new GridConstraints(0, 1, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - runPerDayRadioButton = new JRadioButton(); - runPerDayRadioButton.setText("每天固定时间开始推送:"); - schedulePanel.add(runPerDayRadioButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - startPerDayTextField = new JTextField(); - schedulePanel.add(startPerDayTextField, new GridConstraints(1, 1, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - runPerWeekRadioButton = new JRadioButton(); - runPerWeekRadioButton.setText("每周固定时间开始推送:"); - schedulePanel.add(runPerWeekRadioButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label12 = new JLabel(); - label12.setText("yyyy-MM-dd HH:mm:ss"); - schedulePanel.add(label12, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label13 = new JLabel(); - label13.setText("HH:mm:ss"); - schedulePanel.add(label13, new GridConstraints(1, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label14 = new JLabel(); - label14.setText("HH:mm:ss"); - schedulePanel.add(label14, new GridConstraints(2, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - scheduleSaveButton = new JButton(); - scheduleSaveButton.setText("保存"); - schedulePanel.add(scheduleSaveButton, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label15 = new JLabel(); - label15.setText("每周"); - schedulePanel.add(label15, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label16 = new JLabel(); - label16.setText("的"); - schedulePanel.add(label16, new GridConstraints(2, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - schedulePerWeekComboBox = new JComboBox(); - final DefaultComboBoxModel defaultComboBoxModel4 = new DefaultComboBoxModel(); - defaultComboBoxModel4.addElement("一"); - defaultComboBoxModel4.addElement("二"); - defaultComboBoxModel4.addElement("三"); - defaultComboBoxModel4.addElement("四"); - defaultComboBoxModel4.addElement("五"); - defaultComboBoxModel4.addElement("六"); - defaultComboBoxModel4.addElement("日"); - schedulePerWeekComboBox.setModel(defaultComboBoxModel4); - schedulePanel.add(schedulePerWeekComboBox, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - startPerWeekTextField = new JTextField(); - schedulePanel.add(startPerWeekTextField, new GridConstraints(2, 4, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + pushPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1)); + tabbedPane.addTab("④开始推送", pushPanel); pushHisPanel = new JPanel(); pushHisPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); tabbedPane.addTab("推送历史管理", pushHisPanel); - final JSplitPane splitPane1 = new JSplitPane(); - splitPane1.setDoubleBuffered(true); - splitPane1.setResizeWeight(0.0); - pushHisPanel.add(splitPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); - final JPanel panel9 = new JPanel(); - panel9.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); - panel9.setMinimumSize(new Dimension(50, 24)); - panel9.setPreferredSize(new Dimension(460, 24)); - splitPane1.setLeftComponent(panel9); - final JPanel panel10 = new JPanel(); - panel10.setLayout(new GridLayoutManager(1, 4, new Insets(0, 10, 0, 0), -1, -1)); - panel9.add(panel10, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - pushHisLeftSelectAllButton = new JButton(); - pushHisLeftSelectAllButton.setText("全选"); - panel10.add(pushHisLeftSelectAllButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer11 = new Spacer(); - panel10.add(spacer11, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - pushHisLeftDeleteButton = new JButton(); - pushHisLeftDeleteButton.setText("删除"); - panel10.add(pushHisLeftDeleteButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushHisExportButton = new JButton(); - pushHisExportButton.setText("导出"); - panel10.add(pushHisExportButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JScrollPane scrollPane7 = new JScrollPane(); - panel9.add(scrollPane7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - pushHisLeftTable = new JTable(); - pushHisLeftTable.setRowHeight(40); - scrollPane7.setViewportView(pushHisLeftTable); - final JPanel panel11 = new JPanel(); - panel11.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); - splitPane1.setRightComponent(panel11); - final JPanel panel12 = new JPanel(); - panel12.setLayout(new GridLayoutManager(1, 4, new Insets(0, 10, 0, 10), -1, -1)); - panel11.add(panel12, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - final Spacer spacer12 = new Spacer(); - panel12.add(spacer12, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - pushHisCountLabel = new JLabel(); - pushHisCountLabel.setText(""); - panel12.add(pushHisCountLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - pushHisCopyButton = new JButton(); - pushHisCopyButton.setText("复制"); - panel12.add(pushHisCopyButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JScrollPane scrollPane8 = new JScrollPane(); - panel11.add(scrollPane8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - pushHisTextArea = new JTextArea(); - pushHisTextArea.setEditable(false); - scrollPane8.setViewportView(pushHisTextArea); + schedulePanel = new JPanel(); + schedulePanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1)); + tabbedPane.addTab("计划任务", schedulePanel); settingPanel = new JPanel(); settingPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); Font settingPanelFont = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, settingPanel.getFont()); if (settingPanelFont != null) settingPanel.setFont(settingPanelFont); tabbedPane.addTab("设置", settingPanel); - settingScrollPane = new JScrollPane(); - settingPanel.add(settingScrollPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JPanel panel13 = new JPanel(); - panel13.setLayout(new GridLayoutManager(10, 1, new Insets(10, 10, 10, 10), -1, -1)); - settingScrollPane.setViewportView(panel13); - final JPanel panel14 = new JPanel(); - panel14.setLayout(new GridLayoutManager(6, 3, new Insets(15, 15, 10, 0), -1, -1)); - Font panel14Font = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, panel14.getFont()); - if (panel14Font != null) panel14.setFont(panel14Font); - panel13.add(panel14, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel14.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "微信公众号", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel14.getFont()))); - final JLabel label17 = new JLabel(); - label17.setText("AppID"); - panel14.add(label17, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer13 = new Spacer(); - panel14.add(spacer13, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer14 = new Spacer(); - panel14.add(spacer14, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - wechatAppIdTextField = new JTextField(); - panel14.add(wechatAppIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label18 = new JLabel(); - label18.setText("AppSecret"); - panel14.add(label18, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - wechatAppSecretPasswordField = new JPasswordField(); - panel14.add(wechatAppSecretPasswordField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label19 = new JLabel(); - label19.setText("Token"); - panel14.add(label19, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - wechatTokenPasswordField = new JPasswordField(); - panel14.add(wechatTokenPasswordField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label20 = new JLabel(); - label20.setText("AES Key"); - panel14.add(label20, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - wechatAesKeyPasswordField = new JPasswordField(); - panel14.add(wechatAesKeyPasswordField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel15 = new JPanel(); - panel15.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - panel14.add(panel15, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingMpInfoSaveButton = new JButton(); - settingMpInfoSaveButton.setText("保存"); - panel15.add(settingMpInfoSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer15 = new Spacer(); - panel15.add(spacer15, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer16 = new Spacer(); - panel13.add(spacer16, new GridConstraints(9, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JPanel panel16 = new JPanel(); - panel16.setLayout(new GridLayoutManager(6, 4, new Insets(15, 15, 10, 0), -1, -1)); - panel13.add(panel16, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel16.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "MySQL数据库", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel16.getFont()))); - final JLabel label21 = new JLabel(); - label21.setText("数据库地址"); - panel16.add(label21, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer17 = new Spacer(); - panel16.add(spacer17, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer18 = new Spacer(); - panel16.add(spacer18, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - mysqlUrlTextField = new JTextField(); - panel16.add(mysqlUrlTextField, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label22 = new JLabel(); - label22.setText("数据库名称"); - panel16.add(label22, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - mysqlDatabaseTextField = new JTextField(); - panel16.add(mysqlDatabaseTextField, new GridConstraints(1, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label23 = new JLabel(); - label23.setText("用户名"); - panel16.add(label23, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - mysqlUserTextField = new JTextField(); - panel16.add(mysqlUserTextField, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label24 = new JLabel(); - label24.setText("密码"); - panel16.add(label24, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - mysqlPasswordField = new JPasswordField(); - panel16.add(mysqlPasswordField, new GridConstraints(3, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel17 = new JPanel(); - panel17.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); - panel16.add(panel17, new GridConstraints(4, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingTestDbLinkButton = new JButton(); - settingTestDbLinkButton.setText("测试连接"); - panel17.add(settingTestDbLinkButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer19 = new Spacer(); - panel17.add(spacer19, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - settingDbInfoSaveButton = new JButton(); - settingDbInfoSaveButton.setText("保存"); - panel17.add(settingDbInfoSaveButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JPanel panel18 = new JPanel(); - panel18.setLayout(new GridLayoutManager(6, 3, new Insets(15, 15, 10, 0), -1, -1)); - panel13.add(panel18, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel18.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "阿里大于短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel18.getFont()))); - final JLabel label25 = new JLabel(); - label25.setText("SMS ServerUrl"); - panel18.add(label25, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer20 = new Spacer(); - panel18.add(spacer20, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer21 = new Spacer(); - panel18.add(spacer21, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - aliServerUrlTextField = new JTextField(); - panel18.add(aliServerUrlTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label26 = new JLabel(); - label26.setText("AppKey"); - panel18.add(label26, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - aliAppKeyPasswordField = new JPasswordField(); - panel18.add(aliAppKeyPasswordField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label27 = new JLabel(); - label27.setText("AppSecret"); - panel18.add(label27, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label28 = new JLabel(); - label28.setText("短信签名"); - panel18.add(label28, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - aliSignTextField = new JTextField(); - panel18.add(aliSignTextField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - aliAppSecretPasswordField = new JPasswordField(); - panel18.add(aliAppSecretPasswordField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel19 = new JPanel(); - panel19.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - panel18.add(panel19, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingAliInfoSaveButton = new JButton(); - settingAliInfoSaveButton.setText("保存"); - panel19.add(settingAliInfoSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer22 = new Spacer(); - panel19.add(spacer22, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final JPanel panel20 = new JPanel(); - panel20.setLayout(new GridLayoutManager(4, 3, new Insets(15, 15, 10, 0), -1, -1)); - panel13.add(panel20, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel20.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "外观", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel20.getFont()))); - final JLabel label29 = new JLabel(); - label29.setText("主题风格"); - panel20.add(label29, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer23 = new Spacer(); - panel20.add(spacer23, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - settingThemeComboBox = new JComboBox(); - final DefaultComboBoxModel defaultComboBoxModel5 = new DefaultComboBoxModel(); - defaultComboBoxModel5.addElement("Darcula(推荐)"); - defaultComboBoxModel5.addElement("BeautyEye"); - defaultComboBoxModel5.addElement("系统默认"); - defaultComboBoxModel5.addElement("weblaf"); - settingThemeComboBox.setModel(defaultComboBoxModel5); - panel20.add(settingThemeComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label30 = new JLabel(); - label30.setText("字体"); - panel20.add(label30, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - settingFontNameComboBox = new JComboBox(); - final DefaultComboBoxModel defaultComboBoxModel6 = new DefaultComboBoxModel(); - defaultComboBoxModel6.addElement("Microsoft YaHei"); - defaultComboBoxModel6.addElement("Microsoft YaHei Light"); - defaultComboBoxModel6.addElement("Microsoft YaHei UI"); - defaultComboBoxModel6.addElement("Microsoft YaHei UI Light"); - settingFontNameComboBox.setModel(defaultComboBoxModel6); - panel20.add(settingFontNameComboBox, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label31 = new JLabel(); - label31.setText("字号"); - panel20.add(label31, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - settingFontSizeComboBox = new JComboBox(); - final DefaultComboBoxModel defaultComboBoxModel7 = new DefaultComboBoxModel(); - defaultComboBoxModel7.addElement("10"); - defaultComboBoxModel7.addElement("11"); - defaultComboBoxModel7.addElement("12"); - defaultComboBoxModel7.addElement("13"); - defaultComboBoxModel7.addElement("14"); - defaultComboBoxModel7.addElement("15"); - defaultComboBoxModel7.addElement("16"); - defaultComboBoxModel7.addElement("17"); - defaultComboBoxModel7.addElement("18"); - defaultComboBoxModel7.addElement("19"); - defaultComboBoxModel7.addElement("20"); - defaultComboBoxModel7.addElement("21"); - defaultComboBoxModel7.addElement("22"); - defaultComboBoxModel7.addElement("23"); - defaultComboBoxModel7.addElement("24"); - defaultComboBoxModel7.addElement("25"); - defaultComboBoxModel7.addElement("26"); - settingFontSizeComboBox.setModel(defaultComboBoxModel7); - panel20.add(settingFontSizeComboBox, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JPanel panel21 = new JPanel(); - panel21.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - panel20.add(panel21, new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingAppearanceSaveButton = new JButton(); - settingAppearanceSaveButton.setText("保存"); - panel21.add(settingAppearanceSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer24 = new Spacer(); - panel21.add(spacer24, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final JPanel panel22 = new JPanel(); - panel22.setLayout(new GridLayoutManager(2, 2, new Insets(15, 15, 10, 0), -1, -1)); - panel13.add(panel22, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel22.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "常规", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel22.getFont()))); - autoCheckUpdateCheckBox = new JCheckBox(); - autoCheckUpdateCheckBox.setText("启动时自动检查更新"); - panel22.add(autoCheckUpdateCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer25 = new Spacer(); - panel22.add(spacer25, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer26 = new Spacer(); - panel22.add(spacer26, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JPanel panel23 = new JPanel(); - panel23.setLayout(new GridLayoutManager(5, 4, new Insets(15, 15, 10, 0), -1, -1)); - panel13.add(panel23, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel23.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "阿里云短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel23.getFont()))); - final Spacer spacer27 = new Spacer(); - panel23.add(spacer27, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JLabel label32 = new JLabel(); - label32.setText("AccessKeyId"); - panel23.add(label32, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label33 = new JLabel(); - label33.setText("AccessKeySecret"); - panel23.add(label33, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label34 = new JLabel(); - label34.setText("短信签名"); - panel23.add(label34, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - aliyunSignTextField = new JTextField(); - panel23.add(aliyunSignTextField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - aliyunAccessKeySecretTextField = new JPasswordField(); - panel23.add(aliyunAccessKeySecretTextField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel24 = new JPanel(); - panel24.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - panel23.add(panel24, new GridConstraints(3, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingAliyunSaveButton = new JButton(); - settingAliyunSaveButton.setText("保存"); - panel24.add(settingAliyunSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer28 = new Spacer(); - panel24.add(spacer28, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer29 = new Spacer(); - panel23.add(spacer29, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - aliyunAccessKeyIdTextField = new JTextField(); - panel23.add(aliyunAccessKeyIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel25 = new JPanel(); - panel25.setLayout(new GridLayoutManager(6, 3, new Insets(15, 15, 10, 0), -1, -1)); - Font panel25Font = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, panel25.getFont()); - if (panel25Font != null) panel25.setFont(panel25Font); - panel13.add(panel25, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel25.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "微信小程序", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel25.getFont()))); - final JLabel label35 = new JLabel(); - label35.setText("AppID"); - panel25.add(label35, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer30 = new Spacer(); - panel25.add(spacer30, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer31 = new Spacer(); - panel25.add(spacer31, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - miniAppAppIdTextField = new JTextField(); - panel25.add(miniAppAppIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label36 = new JLabel(); - label36.setText("AppSecret"); - panel25.add(label36, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - miniAppAppSecretPasswordField = new JPasswordField(); - panel25.add(miniAppAppSecretPasswordField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label37 = new JLabel(); - label37.setText("Token"); - panel25.add(label37, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - miniAppTokenPasswordField = new JPasswordField(); - miniAppTokenPasswordField.setText(""); - panel25.add(miniAppTokenPasswordField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JLabel label38 = new JLabel(); - label38.setText("AES Key"); - panel25.add(label38, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - miniAppAesKeyPasswordField = new JPasswordField(); - panel25.add(miniAppAesKeyPasswordField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel26 = new JPanel(); - panel26.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - panel25.add(panel26, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingMaInfoSaveButton = new JButton(); - settingMaInfoSaveButton.setText("保存"); - panel26.add(settingMaInfoSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer32 = new Spacer(); - panel26.add(spacer32, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final JPanel panel27 = new JPanel(); - panel27.setLayout(new GridLayoutManager(5, 4, new Insets(15, 15, 10, 0), -1, -1)); - panel13.add(panel27, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel27.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "腾讯云短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel27.getFont()))); - final Spacer spacer33 = new Spacer(); - panel27.add(spacer33, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JLabel label39 = new JLabel(); - label39.setText("AppId"); - panel27.add(label39, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label40 = new JLabel(); - label40.setText("AppKey"); - panel27.add(label40, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label41 = new JLabel(); - label41.setText("短信签名"); - panel27.add(label41, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - txyunSignTextField = new JTextField(); - panel27.add(txyunSignTextField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - txyunAppKeyTextField = new JPasswordField(); - txyunAppKeyTextField.setText(""); - panel27.add(txyunAppKeyTextField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel28 = new JPanel(); - panel28.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - panel27.add(panel28, new GridConstraints(3, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingTxyunSaveButton = new JButton(); - settingTxyunSaveButton.setText("保存"); - panel28.add(settingTxyunSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer34 = new Spacer(); - panel28.add(spacer34, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer35 = new Spacer(); - panel27.add(spacer35, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - txyunAppIdTextField = new JTextField(); - panel27.add(txyunAppIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel29 = new JPanel(); - panel29.setLayout(new GridLayoutManager(3, 4, new Insets(15, 15, 10, 0), -1, -1)); - panel13.add(panel29, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - panel29.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "云片网短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel29.getFont()))); - final Spacer spacer36 = new Spacer(); - panel29.add(spacer36, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - final JLabel label42 = new JLabel(); - label42.setText("ApiKey"); - panel29.add(label42, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - yunpianApiKeyTextField = new JPasswordField(); - yunpianApiKeyTextField.setText(""); - panel29.add(yunpianApiKeyTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); - final JPanel panel30 = new JPanel(); - panel30.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - panel29.add(panel30, new GridConstraints(1, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - settingYunpianSaveButton = new JButton(); - settingYunpianSaveButton.setText("保存"); - panel30.add(settingYunpianSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final Spacer spacer37 = new Spacer(); - panel30.add(spacer37, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final Spacer spacer38 = new Spacer(); - panel29.add(spacer38, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); - final JPanel panel31 = new JPanel(); - panel31.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 10, 0), -1, -1)); - tabbedPane.addTab("他们都在用", panel31); - userCaseScrollPane = new JScrollPane(); - panel31.add(userCaseScrollPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); - userCaseListPanel = new JPanel(); - userCaseListPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); - userCaseScrollPane.setViewportView(userCaseListPanel); - final JPanel panel32 = new JPanel(); - panel32.setLayout(new GridLayoutManager(5, 1, new Insets(10, 10, 0, 0), -1, -1)); - panel31.add(panel32, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); - final JLabel label43 = new JLabel(); - label43.setText("产品信息将会在这里展示,帮助宣传您的产品"); - panel32.add(label43, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label44 = new JLabel(); - Font label44Font = this.$$$getFont$$$(null, Font.BOLD, -1, label44.getFont()); - if (label44Font != null) label44.setFont(label44Font); - label44.setText("WePush不会收集用户的任何信息"); - panel32.add(label44, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label45 = new JLabel(); - label45.setText("也正因如此,我无法得知哪些优秀的企业或个人在使用WePush"); - panel32.add(label45, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label46 = new JLabel(); - label46.setText("如果WePush能给您带来一些便利"); - panel32.add(label46, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - final JLabel label47 = new JLabel(); - label47.setText("欢迎将您的产品邮件告诉我:rememberber@163.com"); - panel32.add(label47, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - msgTypeLabel.setLabelFor(msgTypeComboBox); - msgNameLabel.setLabelFor(msgNameField); - previewMemberLabel.setLabelFor(previewUserField); - templateIdLabel.setLabelFor(msgTemplateIdTextField); - templateUrlLabel.setLabelFor(msgTemplateUrlTextField); - templateMsgNameLabel.setLabelFor(templateDataNameTextField); - templateMsgValueLabel.setLabelFor(templateDataValueTextField); - templateMsgColorLabel.setLabelFor(templateDataColorTextField); - templateMiniProgramAppidLabel.setLabelFor(msgTemplateMiniAppidTextField); - templateMiniProgramPagePathLabel.setLabelFor(msgTemplateMiniPagePathTextField); - templateKeyWordLabel.setLabelFor(msgTemplateUrlTextField); - kefuMsgTypeLabel.setLabelFor(msgKefuMsgTypeComboBox); - kefuMsgTitleLabel.setLabelFor(msgKefuMsgTitleTextField); - kefuMsgPicUrlLabel.setLabelFor(msgKefuPicUrlTextField); - kefuMsgDescLabel.setLabelFor(msgKefuDescTextField); - kefuMsgUrlLabel.setLabelFor(msgKefuUrlTextField); + userCasePanel = new JPanel(); + userCasePanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 10, 0), -1, -1)); + tabbedPane.addTab("他们都在用", userCasePanel); } /** diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MemberForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/MemberForm.form new file mode 100644 index 00000000..d0438242 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MemberForm.form @@ -0,0 +1,415 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MemberForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/MemberForm.java new file mode 100644 index 00000000..f26cd3d2 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MemberForm.java @@ -0,0 +1,298 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.logic.PushData; +import com.fangxuele.tool.push.ui.Init; +import com.fangxuele.tool.push.ui.listener.MemberListener; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableModel; +import java.awt.*; +import java.util.ArrayList; +import java.util.Collections; + +/** + *
+ * MemberForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class MemberForm { + private JPanel memberPanelRight; + private JPanel memberTabUpPanel; + private JLabel memberTabCountLabel; + private JProgressBar memberTabImportProgressBar; + private JButton clearImportButton; + private JPanel memberTabDownPanel; + private JLabel importFromFileLabel; + private JTextField memberFilePathField; + private JButton importFromFileButton; + private JButton memberImportExploreButton; + private JPanel memberTabCenterPanel; + private JTextArea importFromSqlTextArea; + private JButton importFromSqlButton; + private JButton memberImportTagButton; + private JComboBox memberImportTagComboBox; + private JButton memberImportTagFreshButton; + private JButton memberImportTagRetainButton; + private JButton memberImportAllButton; + private JTable memberListTable; + private JPanel memberPanel; + private JButton selectAllButton; + private JButton importSelectedButton; + private JButton deleteButton; + private JTextField searchTextField; + private JButton searchButton; + private JButton exportButton; + private JPanel importFromWeixinPanel; + private JCheckBox importOptionOpenIdCheckBox; + private JCheckBox importOptionBasicInfoCheckBox; + private JCheckBox importOptionAvatarCheckBox; + private JPanel importOptionPanel; + private JButton clearDbCacheButton; + + public static MemberForm memberForm = new MemberForm(); + + /** + * 初始化导入用户tab + */ + public static void init() { + memberForm.getMemberTabImportProgressBar().setVisible(false); + memberForm.getImportFromSqlTextArea().setText(Init.config.getMemberSql()); + memberForm.getMemberFilePathField().setText(Init.config.getMemberFilePath()); + + } + + /** + * 清除 + */ + public static void clearMember() { + PushData.allUser = Collections.synchronizedList(new ArrayList<>()); + PushData.allUser.clear(); + memberForm.getMemberTabCountLabel().setText("0"); + + String[] headerNames = {"数据"}; + DefaultTableModel model = new DefaultTableModel(null, headerNames); + memberForm.getMemberListTable().setModel(model); + + MemberListener.tagUserSet = null; + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + memberPanel = new JPanel(); + memberPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + memberPanel.setMinimumSize(new Dimension(1280, 738)); + memberPanel.setOpaque(true); + memberPanel.setPreferredSize(new Dimension(1280, 738)); + final JSplitPane splitPane1 = new JSplitPane(); + splitPane1.setContinuousLayout(true); + splitPane1.setDividerLocation(900); + splitPane1.setDividerSize(4); + splitPane1.setDoubleBuffered(true); + splitPane1.setLastDividerLocation(800); + memberPanel.add(splitPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1)); + splitPane1.setLeftComponent(panel1); + final JScrollPane scrollPane1 = new JScrollPane(); + panel1.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + memberListTable = new JTable(); + memberListTable.setGridColor(new Color(-12236470)); + memberListTable.setRowHeight(46); + scrollPane1.setViewportView(memberListTable); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(1, 5, new Insets(0, 5, 0, 0), -1, -1)); + panel1.add(panel2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + selectAllButton = new JButton(); + selectAllButton.setIcon(new ImageIcon(getClass().getResource("/icon/selectall_dark.png"))); + selectAllButton.setText("全选"); + panel2.add(selectAllButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + importSelectedButton = new JButton(); + importSelectedButton.setIcon(new ImageIcon(getClass().getResource("/icon/import_dark.png"))); + importSelectedButton.setText("导入"); + panel2.add(importSelectedButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + exportButton = new JButton(); + exportButton.setIcon(new ImageIcon(getClass().getResource("/icon/export_dark.png"))); + exportButton.setText("导出"); + panel2.add(exportButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + deleteButton = new JButton(); + deleteButton.setIcon(new ImageIcon(getClass().getResource("/icon/remove.png"))); + deleteButton.setText("删除"); + panel2.add(deleteButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel2.add(spacer1, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(1, 2, new Insets(5, 5, 0, 5), -1, -1)); + panel1.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + searchTextField = new JTextField(); + panel3.add(searchTextField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + searchButton = new JButton(); + searchButton.setIcon(new ImageIcon(getClass().getResource("/icon/find_dark.png"))); + searchButton.setText("搜索"); + panel3.add(searchButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel4 = new JPanel(); + panel4.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + splitPane1.setRightComponent(panel4); + memberPanelRight = new JPanel(); + memberPanelRight.setLayout(new GridLayoutManager(7, 1, new Insets(0, 0, 0, 0), -1, -1)); + panel4.add(memberPanelRight, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + memberTabUpPanel = new JPanel(); + memberTabUpPanel.setLayout(new GridLayoutManager(6, 6, new Insets(0, 0, 0, 0), -1, -1)); + memberPanelRight.add(memberTabUpPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + memberTabCountLabel = new JLabel(); + Font memberTabCountLabelFont = this.$$$getFont$$$(null, -1, 72, memberTabCountLabel.getFont()); + if (memberTabCountLabelFont != null) memberTabCountLabel.setFont(memberTabCountLabelFont); + memberTabCountLabel.setForeground(new Color(-276358)); + memberTabCountLabel.setText("0"); + memberTabUpPanel.add(memberTabCountLabel, new GridConstraints(0, 0, 4, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberTabImportProgressBar = new JProgressBar(); + memberTabUpPanel.add(memberTabImportProgressBar, new GridConstraints(4, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + memberTabUpPanel.add(spacer2, new GridConstraints(0, 5, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setText("已导入"); + memberTabUpPanel.add(label1, new GridConstraints(0, 3, 4, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JSeparator separator1 = new JSeparator(); + memberTabUpPanel.add(separator1, new GridConstraints(5, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + clearImportButton = new JButton(); + clearImportButton.setText("清除"); + memberTabUpPanel.add(clearImportButton, new GridConstraints(0, 4, 4, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberTabDownPanel = new JPanel(); + memberTabDownPanel.setLayout(new GridLayoutManager(2, 3, new Insets(10, 5, 10, 0), -1, -1)); + memberPanelRight.add(memberTabDownPanel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + memberTabDownPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "通过文件导入", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, memberTabDownPanel.getFont()))); + importFromFileLabel = new JLabel(); + importFromFileLabel.setHorizontalAlignment(11); + importFromFileLabel.setHorizontalTextPosition(4); + importFromFileLabel.setText("文件路径(*.txt,*.csv,*.xlsx)"); + memberTabDownPanel.add(importFromFileLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberFilePathField = new JTextField(); + memberTabDownPanel.add(memberFilePathField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + memberImportExploreButton = new JButton(); + memberImportExploreButton.setText("浏览"); + memberTabDownPanel.add(memberImportExploreButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + importFromFileButton = new JButton(); + importFromFileButton.setIcon(new ImageIcon(getClass().getResource("/icon/import_dark.png"))); + importFromFileButton.setText("导入"); + memberTabDownPanel.add(importFromFileButton, new GridConstraints(1, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberTabCenterPanel = new JPanel(); + memberTabCenterPanel.setLayout(new GridLayoutManager(3, 1, new Insets(10, 5, 0, 0), -1, -1)); + memberPanelRight.add(memberTabCenterPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + memberTabCenterPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "通过SQL导入", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, memberTabCenterPanel.getFont()))); + importFromSqlTextArea = new JTextArea(); + importFromSqlTextArea.setText(""); + importFromSqlTextArea.setToolTipText("只要查询出的结果集只有一列openid(短信时对应的是手机号)就可以,列名不重要;例如:SELECT openid FROM t_user"); + memberTabCenterPanel.add(importFromSqlTextArea, new GridConstraints(0, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 150), null, 0, false)); + importFromSqlButton = new JButton(); + importFromSqlButton.setIcon(new ImageIcon(getClass().getResource("/icon/import_dark.png"))); + importFromSqlButton.setText("导入"); + memberTabCenterPanel.add(importFromSqlButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer3 = new Spacer(); + memberPanelRight.add(spacer3, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final Spacer spacer4 = new Spacer(); + memberPanelRight.add(spacer4, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + importFromWeixinPanel = new JPanel(); + importFromWeixinPanel.setLayout(new GridLayoutManager(4, 6, new Insets(0, 5, 0, 0), -1, -1)); + memberPanelRight.add(importFromWeixinPanel, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + importFromWeixinPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "通过微信公众平台导入", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, importFromWeixinPanel.getFont()))); + memberImportTagComboBox = new JComboBox(); + final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel(); + memberImportTagComboBox.setModel(defaultComboBoxModel1); + importFromWeixinPanel.add(memberImportTagComboBox, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberImportAllButton = new JButton(); + Font memberImportAllButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportAllButton.getFont()); + if (memberImportAllButtonFont != null) memberImportAllButton.setFont(memberImportAllButtonFont); + memberImportAllButton.setIcon(new ImageIcon(getClass().getResource("/icon/import_dark.png"))); + memberImportAllButton.setText("导入所有关注公众号的用户"); + importFromWeixinPanel.add(memberImportAllButton, new GridConstraints(3, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberImportTagFreshButton = new JButton(); + Font memberImportTagFreshButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportTagFreshButton.getFont()); + if (memberImportTagFreshButtonFont != null) memberImportTagFreshButton.setFont(memberImportTagFreshButtonFont); + memberImportTagFreshButton.setIcon(new ImageIcon(getClass().getResource("/icon/refresh.png"))); + memberImportTagFreshButton.setText("刷新可选的标签分组"); + importFromWeixinPanel.add(memberImportTagFreshButton, new GridConstraints(0, 3, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberImportTagButton = new JButton(); + Font memberImportTagButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportTagButton.getFont()); + if (memberImportTagButtonFont != null) memberImportTagButton.setFont(memberImportTagButtonFont); + memberImportTagButton.setIcon(new ImageIcon(getClass().getResource("/icon/import_dark.png"))); + memberImportTagButton.setText("导入选择的标签分组-取并集"); + importFromWeixinPanel.add(memberImportTagButton, new GridConstraints(1, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + memberImportTagRetainButton = new JButton(); + Font memberImportTagRetainButtonFont = this.$$$getFont$$$(null, Font.PLAIN, -1, memberImportTagRetainButton.getFont()); + if (memberImportTagRetainButtonFont != null) + memberImportTagRetainButton.setFont(memberImportTagRetainButtonFont); + memberImportTagRetainButton.setIcon(new ImageIcon(getClass().getResource("/icon/import_dark.png"))); + memberImportTagRetainButton.setText("导入选择的标签分组-取交集"); + importFromWeixinPanel.add(memberImportTagRetainButton, new GridConstraints(2, 0, 1, 6, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + importOptionPanel = new JPanel(); + importOptionPanel.setLayout(new GridLayoutManager(1, 5, new Insets(0, 0, 0, 0), -1, -1)); + memberPanelRight.add(importOptionPanel, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + importOptionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-276358)), "导入选项", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, importOptionPanel.getFont()), new Color(-276358))); + importOptionOpenIdCheckBox = new JCheckBox(); + importOptionOpenIdCheckBox.setEnabled(false); + importOptionOpenIdCheckBox.setSelected(true); + importOptionOpenIdCheckBox.setText("openId"); + importOptionPanel.add(importOptionOpenIdCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer5 = new Spacer(); + importOptionPanel.add(spacer5, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + importOptionBasicInfoCheckBox = new JCheckBox(); + importOptionBasicInfoCheckBox.setText("昵称、性别等基本信息"); + importOptionBasicInfoCheckBox.setToolTipText("每获取一条信息会花费一次每日接口调用量"); + importOptionPanel.add(importOptionBasicInfoCheckBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + importOptionAvatarCheckBox = new JCheckBox(); + importOptionAvatarCheckBox.setText("头像"); + importOptionAvatarCheckBox.setToolTipText("勾选会导致左侧列表甚至WePush变卡哦"); + importOptionPanel.add(importOptionAvatarCheckBox, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + clearDbCacheButton = new JButton(); + clearDbCacheButton.setText("清空本地缓存"); + importOptionPanel.add(clearDbCacheButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return memberPanel; + } + +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MessageEditForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/MessageEditForm.form new file mode 100644 index 00000000..c3766f1d --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MessageEditForm.form @@ -0,0 +1,450 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MessageEditForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/MessageEditForm.java new file mode 100644 index 00000000..b57f0e49 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MessageEditForm.java @@ -0,0 +1,579 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.dao.TMsgKefuMapper; +import com.fangxuele.tool.push.dao.TMsgKefuPriorityMapper; +import com.fangxuele.tool.push.dao.TMsgMaTemplateMapper; +import com.fangxuele.tool.push.dao.TMsgMpTemplateMapper; +import com.fangxuele.tool.push.dao.TMsgSmsMapper; +import com.fangxuele.tool.push.dao.TTemplateDataMapper; +import com.fangxuele.tool.push.domain.TMsgKefu; +import com.fangxuele.tool.push.domain.TMsgKefuPriority; +import com.fangxuele.tool.push.domain.TMsgMaTemplate; +import com.fangxuele.tool.push.domain.TMsgMpTemplate; +import com.fangxuele.tool.push.domain.TMsgSms; +import com.fangxuele.tool.push.domain.TTemplateData; +import com.fangxuele.tool.push.logic.MessageTypeEnum; +import com.fangxuele.tool.push.ui.Init; +import com.fangxuele.tool.push.ui.component.TableInCellButtonColumn; +import com.fangxuele.tool.push.util.MybatisUtil; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableColumnModel; +import java.awt.*; +import java.util.List; + +/** + *
+ * MessageEditForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class MessageEditForm { + private JPanel messageEditPanel; + private JLabel msgNameLabel; + private JTextField msgNameField; + private JLabel previewMemberLabel; + private JTextField previewUserField; + private JButton previewMsgButton; + private JButton msgSaveButton; + private JPanel templateMsgPanel; + private JLabel templateIdLabel; + private JTextField msgTemplateIdTextField; + private JLabel templateUrlLabel; + private JTextField msgTemplateUrlTextField; + private JPanel templateMsgDataPanel; + private JLabel templateMsgNameLabel; + private JTextField templateDataNameTextField; + private JLabel templateMsgValueLabel; + private JTextField templateDataValueTextField; + private JLabel templateMsgColorLabel; + private JTextField templateDataColorTextField; + private JButton templateMsgDataAddButton; + private JTable templateMsgDataTable; + private JLabel templateMiniProgramAppidLabel; + private JTextField msgTemplateMiniAppidTextField; + private JLabel templateMiniProgramPagePathLabel; + private JTextField msgTemplateMiniPagePathTextField; + private JLabel templateKeyWordLabel; + private JTextField msgTemplateKeyWordTextField; + private JPanel kefuMsgPanel; + private JLabel kefuMsgTypeLabel; + private JComboBox msgKefuMsgTypeComboBox; + private JLabel kefuMsgTitleLabel; + private JTextField msgKefuMsgTitleTextField; + private JLabel kefuMsgPicUrlLabel; + private JLabel kefuMsgDescLabel; + private JTextField msgKefuPicUrlTextField; + private JTextField msgKefuDescTextField; + private JLabel kefuMsgUrlLabel; + private JTextField msgKefuUrlTextField; + private JPanel yunpianMsgPanel; + private JTextArea msgYunpianMsgContentTextField; + + public static MessageEditForm messageEditForm = new MessageEditForm(); + + private static TMsgKefuMapper msgKefuMapper = MybatisUtil.getSqlSession().getMapper(TMsgKefuMapper.class); + private static TMsgKefuPriorityMapper msgKefuPriorityMapper = MybatisUtil.getSqlSession().getMapper(TMsgKefuPriorityMapper.class); + private static TMsgMaTemplateMapper msgMaTemplateMapper = MybatisUtil.getSqlSession().getMapper(TMsgMaTemplateMapper.class); + private static TMsgMpTemplateMapper msgMpTemplateMapper = MybatisUtil.getSqlSession().getMapper(TMsgMpTemplateMapper.class); + private static TMsgSmsMapper msgSmsMapper = MybatisUtil.getSqlSession().getMapper(TMsgSmsMapper.class); + private static TTemplateDataMapper templateDataMapper = MybatisUtil.getSqlSession().getMapper(TTemplateDataMapper.class); + + /** + * 初始化消息tab + */ + public static void init(String selectedMsgName) { + // 初始化,清空所有相关的输入框内容 + clearAllField(); + + String msgName; + if (StringUtils.isEmpty(selectedMsgName)) { + msgName = Init.config.getMsgName(); + } else { + msgName = selectedMsgName; + } + + messageEditForm.getMsgNameField().setText(msgName); + messageEditForm.getPreviewUserField().setText(Init.config.getPreviewUser()); + + int msgType = Init.config.getMsgType(); + + int msgId = 0; + if (msgType == MessageTypeEnum.KEFU_CODE) { + List tMsgKefuList = msgKefuMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgKefuList.size() > 0) { + TMsgKefu tMsgKefu = tMsgKefuList.get(0); + msgId = tMsgKefu.getId(); + String kefuMsgType = tMsgKefu.getKefuMsgType(); + messageEditForm.getMsgKefuMsgTypeComboBox().setSelectedItem(kefuMsgType); + if ("文本消息".equals(kefuMsgType)) { + messageEditForm.getMsgKefuMsgTitleTextField().setText(tMsgKefu.getContent()); + } else if ("图文消息".equals(kefuMsgType)) { + messageEditForm.getMsgKefuMsgTitleTextField().setText(tMsgKefu.getTitle()); + } + messageEditForm.getMsgKefuPicUrlTextField().setText(tMsgKefu.getImgUrl()); + messageEditForm.getMsgKefuDescTextField().setText(tMsgKefu.getDescribe()); + messageEditForm.getMsgKefuUrlTextField().setText(tMsgKefu.getUrl()); + + switchKefuMsgType(kefuMsgType); + } + } else if (msgType == MessageTypeEnum.KEFU_PRIORITY_CODE) { + List tMsgKefuPriorityList = msgKefuPriorityMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgKefuPriorityList.size() > 0) { + TMsgKefuPriority tMsgKefuPriority = tMsgKefuPriorityList.get(0); + msgId = tMsgKefuPriority.getId(); + messageEditForm.getMsgTemplateIdTextField().setText(tMsgKefuPriority.getTemplateId()); + messageEditForm.getMsgTemplateUrlTextField().setText(tMsgKefuPriority.getUrl()); + messageEditForm.getMsgTemplateMiniAppidTextField().setText(tMsgKefuPriority.getMaAppid()); + messageEditForm.getMsgTemplateMiniPagePathTextField().setText(tMsgKefuPriority.getMaPagePath()); + + String kefuMsgType = tMsgKefuPriority.getKefuMsgType(); + messageEditForm.getMsgKefuMsgTypeComboBox().setSelectedItem(kefuMsgType); + if ("文本消息".equals(kefuMsgType)) { + messageEditForm.getMsgKefuMsgTitleTextField().setText(tMsgKefuPriority.getContent()); + } else if ("图文消息".equals(kefuMsgType)) { + messageEditForm.getMsgKefuMsgTitleTextField().setText(tMsgKefuPriority.getTitle()); + } + messageEditForm.getMsgKefuPicUrlTextField().setText(tMsgKefuPriority.getImgUrl()); + messageEditForm.getMsgKefuDescTextField().setText(tMsgKefuPriority.getDescribe()); + messageEditForm.getMsgKefuUrlTextField().setText(tMsgKefuPriority.getKefuUrl()); + + switchKefuMsgType(kefuMsgType); + } + } else if (msgType == MessageTypeEnum.MA_TEMPLATE_CODE) { + List tMsgMaTemplateList = msgMaTemplateMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgMaTemplateList.size() > 0) { + TMsgMaTemplate tMsgMaTemplate = tMsgMaTemplateList.get(0); + msgId = tMsgMaTemplate.getId(); + messageEditForm.getMsgTemplateIdTextField().setText(tMsgMaTemplate.getTemplateId()); + messageEditForm.getMsgTemplateUrlTextField().setText(tMsgMaTemplate.getPage()); + messageEditForm.getMsgTemplateKeyWordTextField().setText(tMsgMaTemplate.getEmphasisKeyword()); + } + } else if (msgType == MessageTypeEnum.MP_TEMPLATE_CODE) { + List tMsgMpTemplateList = msgMpTemplateMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgMpTemplateList.size() > 0) { + TMsgMpTemplate tMsgMpTemplate = tMsgMpTemplateList.get(0); + msgId = tMsgMpTemplate.getId(); + messageEditForm.getMsgTemplateIdTextField().setText(tMsgMpTemplate.getTemplateId()); + messageEditForm.getMsgTemplateUrlTextField().setText(tMsgMpTemplate.getUrl()); + messageEditForm.getMsgTemplateMiniAppidTextField().setText(tMsgMpTemplate.getMaAppid()); + messageEditForm.getMsgTemplateMiniPagePathTextField().setText(tMsgMpTemplate.getMaPagePath()); + } + } else { + List tMsgSmsList = msgSmsMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgSmsList.size() > 0) { + TMsgSms tMsgSms = tMsgSmsList.get(0); + msgId = tMsgSms.getId(); + if (msgType == MessageTypeEnum.YUN_PIAN_CODE) { + messageEditForm.getMsgYunpianMsgContentTextField().setText(tMsgSms.getContent()); + } else { + messageEditForm.getMsgTemplateIdTextField().setText(tMsgSms.getTemplateId()); + } + } + } + if (msgType != MessageTypeEnum.KEFU_CODE) { + initTemplateDataTable(); + // 模板消息Data表 + List templateDataList = templateDataMapper.selectByMsgTypeAndMsgId(msgType, msgId); + String[] headerNames = {"Name", "Value", "Color", "操作"}; + Object[][] cellData = new String[templateDataList.size()][headerNames.length]; + for (int i = 0; i < templateDataList.size(); i++) { + TTemplateData tTemplateData = templateDataList.get(i); + cellData[i][0] = tTemplateData.getName(); + cellData[i][1] = tTemplateData.getValue(); + cellData[i][2] = tTemplateData.getColor(); + } + DefaultTableModel model = new DefaultTableModel(cellData, headerNames); + messageEditForm.getTemplateMsgDataTable().setModel(model); + TableColumnModel tableColumnModel = messageEditForm.getTemplateMsgDataTable().getColumnModel(); + tableColumnModel.getColumn(headerNames.length - 1). + setCellRenderer(new TableInCellButtonColumn(messageEditForm.getTemplateMsgDataTable(), headerNames.length - 1)); + tableColumnModel.getColumn(headerNames.length - 1). + setCellEditor(new TableInCellButtonColumn(messageEditForm.getTemplateMsgDataTable(), headerNames.length - 1)); + + // 设置列宽 + tableColumnModel.getColumn(3).setPreferredWidth(130); + tableColumnModel.getColumn(3).setMaxWidth(130); + + messageEditForm.getTemplateMsgDataTable().updateUI(); + } + } + + /** + * 清空所有界面字段 + */ + public static void clearAllField() { + messageEditForm.getMsgNameField().setText(""); + messageEditForm.getMsgTemplateIdTextField().setText(""); + messageEditForm.getMsgTemplateUrlTextField().setText(""); + messageEditForm.getMsgKefuMsgTitleTextField().setText(""); + messageEditForm.getMsgKefuPicUrlTextField().setText(""); + messageEditForm.getMsgKefuDescTextField().setText(""); + messageEditForm.getMsgKefuUrlTextField().setText(""); + messageEditForm.getMsgTemplateMiniAppidTextField().setText(""); + messageEditForm.getMsgTemplateMiniPagePathTextField().setText(""); + messageEditForm.getMsgTemplateKeyWordTextField().setText(""); + messageEditForm.getMsgYunpianMsgContentTextField().setText(""); + messageEditForm.getTemplateDataNameTextField().setText(""); + messageEditForm.getTemplateDataValueTextField().setText(""); + messageEditForm.getTemplateDataColorTextField().setText(""); + messageEditForm.getPreviewUserField().setText(""); + initTemplateDataTable(); + } + + /** + * 根据消息类型转换界面显示 + * + * @param msgType + */ + public static void switchMsgType(int msgType) { + messageEditForm.getKefuMsgPanel().setVisible(false); + messageEditForm.getTemplateMsgPanel().setVisible(false); + messageEditForm.getYunpianMsgPanel().setVisible(false); + switch (msgType) { + case MessageTypeEnum.MP_TEMPLATE_CODE: + messageEditForm.getTemplateMsgPanel().setVisible(true); + messageEditForm.getTemplateUrlLabel().setVisible(true); + messageEditForm.getMsgTemplateUrlTextField().setVisible(true); + messageEditForm.getTemplateMiniProgramAppidLabel().setVisible(true); + messageEditForm.getMsgTemplateMiniAppidTextField().setVisible(true); + messageEditForm.getTemplateMiniProgramPagePathLabel().setVisible(true); + messageEditForm.getMsgTemplateMiniPagePathTextField().setVisible(true); + messageEditForm.getTemplateMsgColorLabel().setVisible(true); + messageEditForm.getTemplateDataColorTextField().setVisible(true); + messageEditForm.getMsgTemplateKeyWordTextField().setVisible(false); + messageEditForm.getTemplateKeyWordLabel().setVisible(false); + messageEditForm.getPreviewMemberLabel().setText("预览用户openid"); + break; + case MessageTypeEnum.MA_TEMPLATE_CODE: + messageEditForm.getTemplateMsgPanel().setVisible(true); + messageEditForm.getTemplateUrlLabel().setVisible(true); + messageEditForm.getMsgTemplateUrlTextField().setVisible(true); + messageEditForm.getTemplateMiniProgramAppidLabel().setVisible(false); + messageEditForm.getMsgTemplateMiniAppidTextField().setVisible(false); + messageEditForm.getTemplateMiniProgramPagePathLabel().setVisible(false); + messageEditForm.getMsgTemplateMiniPagePathTextField().setVisible(false); + messageEditForm.getTemplateMsgColorLabel().setVisible(true); + messageEditForm.getTemplateDataColorTextField().setVisible(true); + messageEditForm.getMsgTemplateKeyWordTextField().setVisible(true); + messageEditForm.getTemplateKeyWordLabel().setVisible(true); + messageEditForm.getPreviewMemberLabel().setText("预览用户openid"); + break; + case MessageTypeEnum.KEFU_CODE: + messageEditForm.getKefuMsgPanel().setVisible(true); + messageEditForm.getPreviewMemberLabel().setText("预览用户openid"); + break; + case MessageTypeEnum.KEFU_PRIORITY_CODE: + messageEditForm.getKefuMsgPanel().setVisible(true); + messageEditForm.getTemplateMsgPanel().setVisible(true); + messageEditForm.getTemplateUrlLabel().setVisible(true); + messageEditForm.getMsgTemplateUrlTextField().setVisible(true); + messageEditForm.getTemplateMiniProgramAppidLabel().setVisible(true); + messageEditForm.getMsgTemplateMiniAppidTextField().setVisible(true); + messageEditForm.getTemplateMiniProgramPagePathLabel().setVisible(true); + messageEditForm.getMsgTemplateMiniPagePathTextField().setVisible(true); + messageEditForm.getTemplateMsgColorLabel().setVisible(true); + messageEditForm.getTemplateDataColorTextField().setVisible(true); + messageEditForm.getMsgTemplateKeyWordTextField().setVisible(false); + messageEditForm.getTemplateKeyWordLabel().setVisible(false); + messageEditForm.getPreviewMemberLabel().setText("预览用户openid"); + break; + case MessageTypeEnum.ALI_YUN_CODE: + case MessageTypeEnum.TX_YUN_CODE: + case MessageTypeEnum.ALI_TEMPLATE_CODE: + messageEditForm.getTemplateMsgPanel().setVisible(true); + messageEditForm.getTemplateUrlLabel().setVisible(false); + messageEditForm.getMsgTemplateUrlTextField().setVisible(false); + messageEditForm.getTemplateMiniProgramAppidLabel().setVisible(false); + messageEditForm.getMsgTemplateMiniAppidTextField().setVisible(false); + messageEditForm.getTemplateMiniProgramPagePathLabel().setVisible(false); + messageEditForm.getMsgTemplateMiniPagePathTextField().setVisible(false); + messageEditForm.getTemplateMsgColorLabel().setVisible(false); + messageEditForm.getTemplateDataColorTextField().setVisible(false); + messageEditForm.getMsgTemplateKeyWordTextField().setVisible(false); + messageEditForm.getTemplateKeyWordLabel().setVisible(false); + messageEditForm.getPreviewMemberLabel().setText("预览用户手机号"); + break; + case MessageTypeEnum.YUN_PIAN_CODE: + messageEditForm.getYunpianMsgPanel().setVisible(true); + messageEditForm.getPreviewMemberLabel().setText("预览用户手机号"); + break; + default: + break; + } + } + + /** + * 根据客服消息类型转换界面显示 + * + * @param msgType 消息类型 + */ + public static void switchKefuMsgType(String msgType) { + switch (msgType) { + case "文本消息": + messageEditForm.getKefuMsgTitleLabel().setText("内容"); + messageEditForm.getKefuMsgDescLabel().setVisible(false); + messageEditForm.getMsgKefuDescTextField().setVisible(false); + messageEditForm.getKefuMsgPicUrlLabel().setVisible(false); + messageEditForm.getMsgKefuPicUrlTextField().setVisible(false); + messageEditForm.getMsgKefuDescTextField().setVisible(false); + messageEditForm.getKefuMsgUrlLabel().setVisible(false); + messageEditForm.getMsgKefuUrlTextField().setVisible(false); + break; + case "图文消息": + messageEditForm.getKefuMsgTitleLabel().setText("标题"); + messageEditForm.getKefuMsgDescLabel().setVisible(true); + messageEditForm.getMsgKefuDescTextField().setVisible(true); + messageEditForm.getKefuMsgPicUrlLabel().setVisible(true); + messageEditForm.getMsgKefuPicUrlTextField().setVisible(true); + messageEditForm.getMsgKefuDescTextField().setVisible(true); + messageEditForm.getKefuMsgUrlLabel().setVisible(true); + messageEditForm.getMsgKefuUrlTextField().setVisible(true); + break; + default: + break; + } + } + + /** + * 初始化模板消息数据table + */ + public static void initTemplateDataTable() { + JTable msgDataTable = messageEditForm.getTemplateMsgDataTable(); + String[] headerNames = {"Name", "Value", "Color", "操作"}; + DefaultTableModel model = new DefaultTableModel(null, headerNames); + msgDataTable.setModel(model); + msgDataTable.updateUI(); + DefaultTableCellRenderer hr = (DefaultTableCellRenderer) msgDataTable.getTableHeader().getDefaultRenderer(); + // 表头列名居左 + hr.setHorizontalAlignment(DefaultTableCellRenderer.LEFT); + + TableColumnModel tableColumnModel = msgDataTable.getColumnModel(); + tableColumnModel.getColumn(headerNames.length - 1). + setCellRenderer(new TableInCellButtonColumn(msgDataTable, headerNames.length - 1)); + tableColumnModel.getColumn(headerNames.length - 1). + setCellEditor(new TableInCellButtonColumn(msgDataTable, headerNames.length - 1)); + + // 设置列宽 + tableColumnModel.getColumn(3).setPreferredWidth(130); + tableColumnModel.getColumn(3).setMaxWidth(130); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + messageEditPanel = new JPanel(); + messageEditPanel.setLayout(new GridLayoutManager(3, 5, new Insets(6, 2, 0, 0), -1, -1)); + messageEditPanel.setMaximumSize(new Dimension(-1, -1)); + messageEditPanel.setMinimumSize(new Dimension(-1, -1)); + messageEditPanel.setPreferredSize(new Dimension(-1, -1)); + panel1.add(messageEditPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(1, 4, new Insets(0, 10, 10, 5), -1, -1)); + messageEditPanel.add(panel2, new GridConstraints(0, 0, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + msgNameLabel = new JLabel(); + Font msgNameLabelFont = this.$$$getFont$$$(null, Font.BOLD, -1, msgNameLabel.getFont()); + if (msgNameLabelFont != null) msgNameLabel.setFont(msgNameLabelFont); + msgNameLabel.setText("消息名称 *"); + msgNameLabel.setToolTipText("给本次推送任务起个名字"); + panel2.add(msgNameLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgNameField = new JTextField(); + msgNameField.setToolTipText("给本次推送任务起个名字"); + panel2.add(msgNameField, new GridConstraints(0, 1, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(1, 5, new Insets(0, 10, 0, 5), -1, -1)); + messageEditPanel.add(panel3, new GridConstraints(2, 0, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + previewMemberLabel = new JLabel(); + previewMemberLabel.setText("预览用户openid/手机号"); + previewMemberLabel.setToolTipText("多个以半角分号分隔"); + panel3.add(previewMemberLabel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + previewUserField = new JTextField(); + previewUserField.setToolTipText("多个以半角分号分隔"); + panel3.add(previewUserField, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + previewMsgButton = new JButton(); + previewMsgButton.setIcon(new ImageIcon(getClass().getResource("/icon/preview_dark.png"))); + previewMsgButton.setText("预览"); + panel3.add(previewMsgButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgSaveButton = new JButton(); + msgSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + msgSaveButton.setText("保存"); + panel3.add(msgSaveButton, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel4 = new JPanel(); + panel4.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1)); + messageEditPanel.add(panel4, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + kefuMsgPanel = new JPanel(); + kefuMsgPanel.setLayout(new GridLayoutManager(6, 2, new Insets(10, 0, 0, 0), -1, -1)); + panel4.add(kefuMsgPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + kefuMsgPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "客服消息编辑", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, kefuMsgPanel.getFont()))); + kefuMsgTypeLabel = new JLabel(); + kefuMsgTypeLabel.setText("消息类型"); + kefuMsgPanel.add(kefuMsgTypeLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + kefuMsgPanel.add(spacer1, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + msgKefuMsgTypeComboBox = new JComboBox(); + final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel(); + defaultComboBoxModel1.addElement("图文消息"); + defaultComboBoxModel1.addElement("文本消息"); + msgKefuMsgTypeComboBox.setModel(defaultComboBoxModel1); + kefuMsgPanel.add(msgKefuMsgTypeComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + kefuMsgTitleLabel = new JLabel(); + kefuMsgTitleLabel.setText("内容/标题"); + kefuMsgPanel.add(kefuMsgTitleLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgKefuMsgTitleTextField = new JTextField(); + kefuMsgPanel.add(msgKefuMsgTitleTextField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, new Dimension(380, -1), new Dimension(380, -1), null, 0, false)); + kefuMsgPicUrlLabel = new JLabel(); + kefuMsgPicUrlLabel.setText("图片URL"); + kefuMsgPanel.add(kefuMsgPicUrlLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgKefuPicUrlTextField = new JTextField(); + kefuMsgPanel.add(msgKefuPicUrlTextField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + kefuMsgDescLabel = new JLabel(); + kefuMsgDescLabel.setText("描述"); + kefuMsgPanel.add(kefuMsgDescLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgKefuDescTextField = new JTextField(); + kefuMsgPanel.add(msgKefuDescTextField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + kefuMsgUrlLabel = new JLabel(); + kefuMsgUrlLabel.setText("跳转URL"); + kefuMsgPanel.add(kefuMsgUrlLabel, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgKefuUrlTextField = new JTextField(); + kefuMsgPanel.add(msgKefuUrlTextField, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateMsgPanel = new JPanel(); + templateMsgPanel.setLayout(new GridLayoutManager(6, 3, new Insets(10, 10, 0, 0), -1, -1)); + panel4.add(templateMsgPanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + templateMsgPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "模板消息编辑", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, templateMsgPanel.getFont()))); + templateIdLabel = new JLabel(); + templateIdLabel.setText("模板ID *"); + templateMsgPanel.add(templateIdLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgTemplateIdTextField = new JTextField(); + templateMsgPanel.add(msgTemplateIdTextField, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateUrlLabel = new JLabel(); + templateUrlLabel.setText("跳转URL"); + templateMsgPanel.add(templateUrlLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgTemplateUrlTextField = new JTextField(); + templateMsgPanel.add(msgTemplateUrlTextField, new GridConstraints(1, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateMsgDataPanel = new JPanel(); + templateMsgDataPanel.setLayout(new GridLayoutManager(2, 7, new Insets(10, 0, 0, 0), -1, -1)); + templateMsgPanel.add(templateMsgDataPanel, new GridConstraints(5, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + templateMsgDataPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "模板变量(可使用\"$ENTER$\"作为换行符)", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.ABOVE_TOP)); + templateMsgNameLabel = new JLabel(); + templateMsgNameLabel.setText("name"); + templateMsgNameLabel.setToolTipText("当消息类型是模板消息时的示例:first或者keyword1或者remark之类的"); + templateMsgDataPanel.add(templateMsgNameLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + templateDataNameTextField = new JTextField(); + templateDataNameTextField.setToolTipText("当消息类型是模板消息时的示例:first或者keyword1或者remark之类的"); + templateMsgDataPanel.add(templateDataNameTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateMsgValueLabel = new JLabel(); + templateMsgValueLabel.setText("value"); + templateMsgDataPanel.add(templateMsgValueLabel, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + templateDataValueTextField = new JTextField(); + templateMsgDataPanel.add(templateDataValueTextField, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateMsgColorLabel = new JLabel(); + templateMsgColorLabel.setText("color"); + templateMsgColorLabel.setToolTipText("示例值:FF0000"); + templateMsgDataPanel.add(templateMsgColorLabel, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + templateDataColorTextField = new JTextField(); + templateDataColorTextField.setToolTipText("示例值:FF0000"); + templateMsgDataPanel.add(templateDataColorTextField, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateMsgDataAddButton = new JButton(); + templateMsgDataAddButton.setIcon(new ImageIcon(getClass().getResource("/icon/add.png"))); + templateMsgDataAddButton.setText("添加"); + templateMsgDataPanel.add(templateMsgDataAddButton, new GridConstraints(0, 6, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JScrollPane scrollPane1 = new JScrollPane(); + templateMsgDataPanel.add(scrollPane1, new GridConstraints(1, 0, 1, 7, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + templateMsgDataTable = new JTable(); + templateMsgDataTable.setAutoCreateColumnsFromModel(true); + templateMsgDataTable.setAutoCreateRowSorter(true); + templateMsgDataTable.setGridColor(new Color(-12236470)); + templateMsgDataTable.setRowHeight(40); + scrollPane1.setViewportView(templateMsgDataTable); + templateMiniProgramAppidLabel = new JLabel(); + templateMiniProgramAppidLabel.setText("小程序appid"); + templateMiniProgramAppidLabel.setToolTipText("非必填"); + templateMsgPanel.add(templateMiniProgramAppidLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgTemplateMiniAppidTextField = new JTextField(); + msgTemplateMiniAppidTextField.setText(""); + msgTemplateMiniAppidTextField.setToolTipText("非必填"); + templateMsgPanel.add(msgTemplateMiniAppidTextField, new GridConstraints(3, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateMiniProgramPagePathLabel = new JLabel(); + templateMiniProgramPagePathLabel.setText("小程序页面路径"); + templateMiniProgramPagePathLabel.setToolTipText("非必填"); + templateMsgPanel.add(templateMiniProgramPagePathLabel, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgTemplateMiniPagePathTextField = new JTextField(); + msgTemplateMiniPagePathTextField.setText(""); + msgTemplateMiniPagePathTextField.setToolTipText("非必填"); + templateMsgPanel.add(msgTemplateMiniPagePathTextField, new GridConstraints(4, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + templateKeyWordLabel = new JLabel(); + templateKeyWordLabel.setText("放大关键词"); + templateMsgPanel.add(templateKeyWordLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + msgTemplateKeyWordTextField = new JTextField(); + templateMsgPanel.add(msgTemplateKeyWordTextField, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + yunpianMsgPanel = new JPanel(); + yunpianMsgPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 0, 0, 0), -1, -1)); + panel4.add(yunpianMsgPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + yunpianMsgPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "云片网短信编辑", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, yunpianMsgPanel.getFont()))); + final JScrollPane scrollPane2 = new JScrollPane(); + yunpianMsgPanel.add(scrollPane2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(72, 19), null, 0, false)); + msgYunpianMsgContentTextField = new JTextArea(); + msgYunpianMsgContentTextField.setPreferredSize(new Dimension(0, 200)); + scrollPane2.setViewportView(msgYunpianMsgContentTextField); + msgNameLabel.setLabelFor(msgNameField); + previewMemberLabel.setLabelFor(previewUserField); + kefuMsgTypeLabel.setLabelFor(msgKefuMsgTypeComboBox); + kefuMsgTitleLabel.setLabelFor(msgKefuMsgTitleTextField); + kefuMsgPicUrlLabel.setLabelFor(msgKefuPicUrlTextField); + kefuMsgDescLabel.setLabelFor(msgKefuDescTextField); + kefuMsgUrlLabel.setLabelFor(msgKefuUrlTextField); + templateIdLabel.setLabelFor(msgTemplateIdTextField); + templateUrlLabel.setLabelFor(msgTemplateUrlTextField); + templateMsgNameLabel.setLabelFor(templateDataNameTextField); + templateMsgValueLabel.setLabelFor(templateDataValueTextField); + templateMsgColorLabel.setLabelFor(templateDataColorTextField); + templateMiniProgramAppidLabel.setLabelFor(msgTemplateMiniAppidTextField); + templateMiniProgramPagePathLabel.setLabelFor(msgTemplateMiniPagePathTextField); + templateKeyWordLabel.setLabelFor(msgTemplateUrlTextField); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + } + +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MessageManageForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/MessageManageForm.form new file mode 100644 index 00000000..8b4a966a --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MessageManageForm.form @@ -0,0 +1,78 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MessageManageForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/MessageManageForm.java new file mode 100644 index 00000000..f93a0798 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MessageManageForm.java @@ -0,0 +1,149 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.dao.TMsgKefuMapper; +import com.fangxuele.tool.push.dao.TMsgKefuPriorityMapper; +import com.fangxuele.tool.push.dao.TMsgMaTemplateMapper; +import com.fangxuele.tool.push.dao.TMsgMpTemplateMapper; +import com.fangxuele.tool.push.dao.TMsgSmsMapper; +import com.fangxuele.tool.push.domain.TMsgKefu; +import com.fangxuele.tool.push.domain.TMsgKefuPriority; +import com.fangxuele.tool.push.domain.TMsgMaTemplate; +import com.fangxuele.tool.push.domain.TMsgMpTemplate; +import com.fangxuele.tool.push.domain.TMsgSms; +import com.fangxuele.tool.push.logic.MessageTypeEnum; +import com.fangxuele.tool.push.ui.Init; +import com.fangxuele.tool.push.util.JTableUtil; +import com.fangxuele.tool.push.util.MybatisUtil; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; + +import javax.swing.*; +import javax.swing.table.DefaultTableModel; +import java.awt.*; +import java.util.List; + +/** + *
+ * MessageManageForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class MessageManageForm { + + private JPanel messageManagePanel; + private JTable msgHistable; + private JButton msgHisTableDeleteButton; + private JButton createMsgButton; + + public static MessageManageForm messageManageForm = new MessageManageForm(); + + private static TMsgKefuMapper msgKefuMapper = MybatisUtil.getSqlSession().getMapper(TMsgKefuMapper.class); + private static TMsgKefuPriorityMapper msgKefuPriorityMapper = MybatisUtil.getSqlSession().getMapper(TMsgKefuPriorityMapper.class); + private static TMsgMaTemplateMapper msgMaTemplateMapper = MybatisUtil.getSqlSession().getMapper(TMsgMaTemplateMapper.class); + private static TMsgMpTemplateMapper msgMpTemplateMapper = MybatisUtil.getSqlSession().getMapper(TMsgMpTemplateMapper.class); + private static TMsgSmsMapper msgSmsMapper = MybatisUtil.getSqlSession().getMapper(TMsgSmsMapper.class); + + /** + * 初始化消息列表 + */ + public static void init() { + // 历史消息管理 + String[] headerNames = {"消息名称"}; + DefaultTableModel model = new DefaultTableModel(null, headerNames); + messageManageForm.getMsgHistable().setModel(model); + // 隐藏表头 + JTableUtil.hideTableHeader(messageManageForm.getMsgHistable()); + + int msgType = Init.config.getMsgType(); + + Object[] data; + + if (msgType == MessageTypeEnum.KEFU_CODE) { + List tMsgKefuList = msgKefuMapper.selectByMsgType(msgType); + for (TMsgKefu tMsgKefu : tMsgKefuList) { + data = new Object[1]; + data[0] = tMsgKefu.getMsgName(); + model.addRow(data); + } + } else if (msgType == MessageTypeEnum.KEFU_PRIORITY_CODE) { + List tMsgKefuPriorityList = msgKefuPriorityMapper.selectByMsgType(msgType); + for (TMsgKefuPriority tMsgKefuPriority : tMsgKefuPriorityList) { + data = new Object[1]; + data[0] = tMsgKefuPriority.getMsgName(); + model.addRow(data); + } + } else if (msgType == MessageTypeEnum.MA_TEMPLATE_CODE) { + List tMsgMaTemplateList = msgMaTemplateMapper.selectByMsgType(msgType); + for (TMsgMaTemplate tMsgMaTemplate : tMsgMaTemplateList) { + data = new Object[1]; + data[0] = tMsgMaTemplate.getMsgName(); + model.addRow(data); + } + } else if (msgType == MessageTypeEnum.MP_TEMPLATE_CODE) { + List tMsgMpTemplateList = msgMpTemplateMapper.selectByMsgType(msgType); + for (TMsgMpTemplate tMsgMpTemplate : tMsgMpTemplateList) { + data = new Object[1]; + data[0] = tMsgMpTemplate.getMsgName(); + model.addRow(data); + } + } else { + List tMsgSmsList = msgSmsMapper.selectByMsgType(msgType); + for (TMsgSms tMsgSms : tMsgSmsList) { + data = new Object[1]; + data[0] = tMsgSms.getMsgName(); + model.addRow(data); + } + } + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + messageManagePanel = new JPanel(); + messageManagePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + messageManagePanel.setMaximumSize(new Dimension(-1, -1)); + messageManagePanel.setMinimumSize(new Dimension(-1, -1)); + messageManagePanel.setPreferredSize(new Dimension(280, -1)); + panel1.add(messageManagePanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final JScrollPane scrollPane1 = new JScrollPane(); + messageManagePanel.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + msgHistable = new JTable(); + msgHistable.setGridColor(new Color(-12236470)); + msgHistable.setRowHeight(46); + msgHistable.setShowVerticalLines(false); + scrollPane1.setViewportView(msgHistable); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); + messageManagePanel.add(panel2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + msgHisTableDeleteButton = new JButton(); + msgHisTableDeleteButton.setIcon(new ImageIcon(getClass().getResource("/icon/remove.png"))); + msgHisTableDeleteButton.setText("删除"); + panel2.add(msgHisTableDeleteButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel2.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + createMsgButton = new JButton(); + createMsgButton.setEnabled(true); + createMsgButton.setIcon(new ImageIcon(getClass().getResource("/icon/add.png"))); + createMsgButton.setText("新建"); + panel2.add(createMsgButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MessageTypeForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/MessageTypeForm.form new file mode 100644 index 00000000..ea0aada9 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MessageTypeForm.form @@ -0,0 +1,205 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/MessageTypeForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/MessageTypeForm.java new file mode 100644 index 00000000..a32983bb --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/MessageTypeForm.java @@ -0,0 +1,222 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.logic.MessageTypeEnum; +import com.fangxuele.tool.push.ui.Init; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; + +import javax.swing.*; +import java.awt.*; + +/** + *
+ * MessageTypeForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/7. + */ +@Getter +public class MessageTypeForm { + private JPanel messageTypePanel; + private JRadioButton mpTemplateRadioButton; + private JRadioButton maTemplateRadioButton; + private JRadioButton kefuRadioButton; + private JRadioButton kefuPriorityRadioButton; + private JRadioButton aliYunRadioButton; + private JRadioButton aliTemplateRadioButton; + private JRadioButton txYunRadioButton; + private JRadioButton yunPianRadioButton; + private JRadioButton upYunRadioButton; + private JRadioButton hwYunRadioButton; + private JRadioButton eMailRadioButton; + private JPanel panel2; + private JRadioButton 网易云信短信RadioButton; + private JRadioButton 榛子云短信RadioButton; + private JRadioButton luosimao短信RadioButton; + private JRadioButton 极光短信RadioButton; + private JRadioButton 极光推送RadioButton; + + public static MessageTypeForm messageTypeForm = new MessageTypeForm(); + + /** + * 初始化消息类型tab + */ + public static void init() { + int msgType = Init.config.getMsgType(); + + switch (msgType) { + case MessageTypeEnum.MP_TEMPLATE_CODE: + messageTypeForm.getMpTemplateRadioButton().setSelected(true); + break; + case MessageTypeEnum.MA_TEMPLATE_CODE: + messageTypeForm.getMaTemplateRadioButton().setSelected(true); + break; + case MessageTypeEnum.KEFU_CODE: + messageTypeForm.getKefuRadioButton().setSelected(true); + break; + case MessageTypeEnum.KEFU_PRIORITY_CODE: + messageTypeForm.getKefuPriorityRadioButton().setSelected(true); + break; + case MessageTypeEnum.ALI_YUN_CODE: + messageTypeForm.getAliYunRadioButton().setSelected(true); + break; + case MessageTypeEnum.ALI_TEMPLATE_CODE: + messageTypeForm.getAliTemplateRadioButton().setSelected(true); + break; + case MessageTypeEnum.TX_YUN_CODE: + messageTypeForm.getTxYunRadioButton().setSelected(true); + break; + case MessageTypeEnum.YUN_PIAN_CODE: + messageTypeForm.getYunPianRadioButton().setSelected(true); + break; + case MessageTypeEnum.UP_YUN_CODE: + messageTypeForm.getUpYunRadioButton().setSelected(true); + break; + case MessageTypeEnum.HW_YUN_CODE: + messageTypeForm.getHwYunRadioButton().setSelected(true); + break; + case MessageTypeEnum.EMAIL_CODE: + messageTypeForm.getEMailRadioButton().setSelected(true); + break; + + default: + } + if (msgType == MessageTypeEnum.MP_TEMPLATE_CODE || msgType == MessageTypeEnum.MA_TEMPLATE_CODE + || msgType == MessageTypeEnum.KEFU_CODE || msgType == MessageTypeEnum.KEFU_PRIORITY_CODE) { + MemberForm.memberForm.getImportFromWeixinPanel().setVisible(true); + MemberForm.memberForm.getImportOptionPanel().setVisible(true); + } else { + MemberForm.memberForm.getImportFromWeixinPanel().setVisible(false); + MemberForm.memberForm.getImportOptionPanel().setVisible(false); + } + MessageEditForm.switchMsgType(msgType); + MessageManageForm.init(); + MessageEditForm.clearAllField(); + MemberForm.init(); + PushHisForm.init(); + } + + /** + * 清除所有radio选中状态 + */ + public static void clearAllSelected() { + messageTypeForm.getMpTemplateRadioButton().setSelected(false); + messageTypeForm.getMaTemplateRadioButton().setSelected(false); + messageTypeForm.getKefuRadioButton().setSelected(false); + messageTypeForm.getKefuPriorityRadioButton().setSelected(false); + messageTypeForm.getAliYunRadioButton().setSelected(false); + messageTypeForm.getAliTemplateRadioButton().setSelected(false); + messageTypeForm.getTxYunRadioButton().setSelected(false); + messageTypeForm.getYunPianRadioButton().setSelected(false); + messageTypeForm.getUpYunRadioButton().setSelected(false); + messageTypeForm.getHwYunRadioButton().setSelected(false); + messageTypeForm.getEMailRadioButton().setSelected(false); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + messageTypePanel = new JPanel(); + messageTypePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + messageTypePanel.setAutoscrolls(false); + final JScrollPane scrollPane1 = new JScrollPane(); + scrollPane1.setAutoscrolls(true); + messageTypePanel.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(16, 2, new Insets(20, 20, 0, 0), -1, -1)); + panel2.setAutoscrolls(true); + scrollPane1.setViewportView(panel2); + mpTemplateRadioButton = new JRadioButton(); + mpTemplateRadioButton.setEnabled(true); + mpTemplateRadioButton.setText("公众号-模板消息"); + panel2.add(mpTemplateRadioButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel2.add(spacer1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + maTemplateRadioButton = new JRadioButton(); + maTemplateRadioButton.setText("小程序-模板消息"); + panel2.add(maTemplateRadioButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + kefuRadioButton = new JRadioButton(); + kefuRadioButton.setText("公众号-客服消息"); + panel2.add(kefuRadioButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + kefuPriorityRadioButton = new JRadioButton(); + kefuPriorityRadioButton.setText("公众号-客服消息优先"); + kefuPriorityRadioButton.setToolTipText("优先尝试发送客服消息,如果失败则发送模板消息"); + panel2.add(kefuPriorityRadioButton, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + aliYunRadioButton = new JRadioButton(); + aliYunRadioButton.setText("阿里云短信"); + panel2.add(aliYunRadioButton, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + aliTemplateRadioButton = new JRadioButton(); + aliTemplateRadioButton.setText("阿里大于模板短信"); + panel2.add(aliTemplateRadioButton, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + txYunRadioButton = new JRadioButton(); + txYunRadioButton.setText("腾讯云短信"); + panel2.add(txYunRadioButton, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + yunPianRadioButton = new JRadioButton(); + yunPianRadioButton.setText("云片网短信"); + panel2.add(yunPianRadioButton, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + upYunRadioButton = new JRadioButton(); + upYunRadioButton.setEnabled(false); + upYunRadioButton.setText("又拍云短信"); + panel2.add(upYunRadioButton, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + hwYunRadioButton = new JRadioButton(); + hwYunRadioButton.setEnabled(false); + hwYunRadioButton.setText("华为云短信"); + panel2.add(hwYunRadioButton, new GridConstraints(9, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + eMailRadioButton = new JRadioButton(); + eMailRadioButton.setEnabled(false); + eMailRadioButton.setText("E-Mail"); + panel2.add(eMailRadioButton, new GridConstraints(15, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + 网易云信短信RadioButton = new JRadioButton(); + 网易云信短信RadioButton.setEnabled(false); + 网易云信短信RadioButton.setText("网易云信短信"); + panel2.add(网易云信短信RadioButton, new GridConstraints(10, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + 榛子云短信RadioButton = new JRadioButton(); + 榛子云短信RadioButton.setEnabled(false); + 榛子云短信RadioButton.setText("榛子云短信"); + panel2.add(榛子云短信RadioButton, new GridConstraints(11, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + luosimao短信RadioButton = new JRadioButton(); + luosimao短信RadioButton.setEnabled(false); + luosimao短信RadioButton.setText("Luosimao短信"); + panel2.add(luosimao短信RadioButton, new GridConstraints(12, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + 极光短信RadioButton = new JRadioButton(); + 极光短信RadioButton.setEnabled(false); + 极光短信RadioButton.setText("极光短信"); + panel2.add(极光短信RadioButton, new GridConstraints(13, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + 极光推送RadioButton = new JRadioButton(); + 极光推送RadioButton.setEnabled(false); + 极光推送RadioButton.setText("极光推送"); + panel2.add(极光推送RadioButton, new GridConstraints(14, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(2, 1, new Insets(8, 8, 8, 0), -1, -1)); + messageTypePanel.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setText("WePush目前仅是各类消息官方SDK的一种实现,"); + panel1.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label2 = new JLabel(); + label2.setText("使用前请仔细查看该消息平台官网的使用规则和开发文档,尤其是发送频率限制等,避免造成不必要的麻烦"); + panel1.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return messageTypePanel; + } + +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/PushForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/PushForm.form new file mode 100644 index 00000000..8b17390b --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/PushForm.form @@ -0,0 +1,360 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/PushForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/PushForm.java new file mode 100644 index 00000000..6dc2e97d --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/PushForm.java @@ -0,0 +1,257 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.ui.Init; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; + +import javax.swing.*; +import java.awt.*; + +/** + *
+ * PushForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class PushForm { + private JPanel pushPanel; + private JPanel pushUpPanel; + private JLabel pushSuccessCount; + private JLabel pushFailCount; + private JLabel pushTotalProgressLabel; + private JProgressBar pushTotalProgressBar; + private JLabel pushLastTimeLabel; + private JLabel pushLeftTimeLabel; + private JLabel jvmMemoryLabel; + private JLabel availableProcessorLabel; + private JLabel pushTotalCountLabel; + private JLabel pushMsgName; + private JLabel scheduleDetailLabel; + private JPanel pushDownPanel; + private JPanel pushControlPanel; + private JTextField maxThreadPoolTextField; + private JTextField threadCountTextField; + private JButton ScheduleRunButton; + private JButton pushStopButton; + private JButton pushStartButton; + private JCheckBox dryRunCheckBox; + private JPanel pushCenterPanel; + private JTextArea pushConsoleTextArea; + private JTable pushThreadTable; + private JLabel countPerThread; + private JSlider threadCountSlider; + + public static PushForm pushForm = new PushForm(); + + /** + * 初始化推送tab + */ + public static void init() { + pushForm.getPushMsgName().setText(Init.config.getMsgName()); + pushForm.getMaxThreadPoolTextField().setText(String.valueOf(Init.config.getMaxThreadPool())); + pushForm.getThreadCountTextField().setText(String.valueOf(Init.config.getThreadCount())); + pushForm.getThreadCountSlider().setMaximum(Init.config.getMaxThreadPool()); + pushForm.getThreadCountSlider().setValue(Init.config.getThreadCount()); + pushForm.getDryRunCheckBox().setSelected(Init.config.isDryRun()); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + pushPanel = new JPanel(); + pushPanel.setLayout(new GridLayoutManager(3, 1, new Insets(0, 2, 0, 2), -1, -1)); + panel1.add(pushPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + pushUpPanel = new JPanel(); + pushUpPanel.setLayout(new GridLayoutManager(8, 13, new Insets(0, 0, 0, 0), -1, -1)); + pushPanel.add(pushUpPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + pushSuccessCount = new JLabel(); + Font pushSuccessCountFont = this.$$$getFont$$$(null, -1, 72, pushSuccessCount.getFont()); + if (pushSuccessCountFont != null) pushSuccessCount.setFont(pushSuccessCountFont); + pushSuccessCount.setForeground(new Color(-13587376)); + pushSuccessCount.setText("0"); + pushUpPanel.add(pushSuccessCount, new GridConstraints(0, 0, 7, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushFailCount = new JLabel(); + Font pushFailCountFont = this.$$$getFont$$$(null, -1, 72, pushFailCount.getFont()); + if (pushFailCountFont != null) pushFailCount.setFont(pushFailCountFont); + pushFailCount.setForeground(new Color(-2200483)); + pushFailCount.setText("0"); + pushUpPanel.add(pushFailCount, new GridConstraints(0, 2, 7, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushTotalProgressLabel = new JLabel(); + pushTotalProgressLabel.setText("总进度"); + pushUpPanel.add(pushTotalProgressLabel, new GridConstraints(6, 8, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushTotalProgressBar = new JProgressBar(); + pushTotalProgressBar.setStringPainted(true); + pushUpPanel.add(pushTotalProgressBar, new GridConstraints(6, 9, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setText("成功"); + pushUpPanel.add(label1, new GridConstraints(2, 1, 3, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label2 = new JLabel(); + label2.setText("失败"); + pushUpPanel.add(label2, new GridConstraints(2, 3, 3, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JSeparator separator1 = new JSeparator(); + separator1.setOrientation(1); + pushUpPanel.add(separator1, new GridConstraints(0, 4, 7, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + pushLastTimeLabel = new JLabel(); + pushLastTimeLabel.setEnabled(true); + Font pushLastTimeLabelFont = this.$$$getFont$$$("Microsoft YaHei UI Light", -1, 36, pushLastTimeLabel.getFont()); + if (pushLastTimeLabelFont != null) pushLastTimeLabel.setFont(pushLastTimeLabelFont); + pushLastTimeLabel.setForeground(new Color(-6710887)); + pushLastTimeLabel.setText("0s"); + pushUpPanel.add(pushLastTimeLabel, new GridConstraints(0, 6, 4, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label3 = new JLabel(); + label3.setHorizontalAlignment(0); + label3.setHorizontalTextPosition(0); + label3.setText("耗时"); + pushUpPanel.add(label3, new GridConstraints(0, 5, 4, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushLeftTimeLabel = new JLabel(); + Font pushLeftTimeLabelFont = this.$$$getFont$$$("Microsoft YaHei UI Light", -1, 36, pushLeftTimeLabel.getFont()); + if (pushLeftTimeLabelFont != null) pushLeftTimeLabel.setFont(pushLeftTimeLabelFont); + pushLeftTimeLabel.setForeground(new Color(-6710887)); + pushLeftTimeLabel.setText("0s"); + pushUpPanel.add(pushLeftTimeLabel, new GridConstraints(4, 6, 3, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JSeparator separator2 = new JSeparator(); + separator2.setOrientation(1); + pushUpPanel.add(separator2, new GridConstraints(0, 7, 7, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + jvmMemoryLabel = new JLabel(); + jvmMemoryLabel.setText("JVM内存占用:--"); + pushUpPanel.add(jvmMemoryLabel, new GridConstraints(4, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + availableProcessorLabel = new JLabel(); + availableProcessorLabel.setText("可用处理器核心:--"); + pushUpPanel.add(availableProcessorLabel, new GridConstraints(3, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushTotalCountLabel = new JLabel(); + pushTotalCountLabel.setText("消息总数:0"); + pushUpPanel.add(pushTotalCountLabel, new GridConstraints(1, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushMsgName = new JLabel(); + Font pushMsgNameFont = this.$$$getFont$$$(null, -1, 24, pushMsgName.getFont()); + if (pushMsgNameFont != null) pushMsgName.setFont(pushMsgNameFont); + pushMsgName.setForeground(new Color(-13587376)); + pushMsgName.setText("消息标题"); + pushUpPanel.add(pushMsgName, new GridConstraints(0, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label4 = new JLabel(); + label4.setText("预计剩余"); + pushUpPanel.add(label4, new GridConstraints(4, 5, 3, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + scheduleDetailLabel = new JLabel(); + scheduleDetailLabel.setForeground(new Color(-276358)); + scheduleDetailLabel.setText(""); + pushUpPanel.add(scheduleDetailLabel, new GridConstraints(5, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + countPerThread = new JLabel(); + countPerThread.setText("每个线程平均分配:0"); + pushUpPanel.add(countPerThread, new GridConstraints(2, 8, 1, 5, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushDownPanel = new JPanel(); + pushDownPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + pushPanel.add(pushDownPanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + pushControlPanel = new JPanel(); + pushControlPanel.setLayout(new GridLayoutManager(1, 10, new Insets(0, 0, 0, 0), -1, -1)); + pushDownPanel.add(pushControlPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final JLabel label5 = new JLabel(); + label5.setText("最大线程池"); + pushControlPanel.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + maxThreadPoolTextField = new JTextField(); + maxThreadPoolTextField.setHorizontalAlignment(10); + maxThreadPoolTextField.setMargin(new Insets(2, 5, 2, 5)); + maxThreadPoolTextField.setRequestFocusEnabled(true); + maxThreadPoolTextField.setToolTipText("输入结束后请按回车键确认"); + pushControlPanel.add(maxThreadPoolTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(60, -1), null, 0, false)); + final JLabel label6 = new JLabel(); + label6.setText("线程数"); + label6.setToolTipText("当前版本受http连接池限制建议不要设置过多线程,推荐100以内"); + pushControlPanel.add(label6, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + threadCountTextField = new JTextField(); + threadCountTextField.setEditable(false); + threadCountTextField.setFocusable(false); + threadCountTextField.setRequestFocusEnabled(false); + threadCountTextField.setToolTipText("当前版本受http连接池限制建议不要设置过多线程,推荐100以内"); + pushControlPanel.add(threadCountTextField, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(60, -1), null, 0, false)); + ScheduleRunButton = new JButton(); + ScheduleRunButton.setIcon(new ImageIcon(getClass().getResource("/icon/clock.png"))); + ScheduleRunButton.setText("按计划执行"); + pushControlPanel.add(ScheduleRunButton, new GridConstraints(0, 7, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushStopButton = new JButton(); + pushStopButton.setEnabled(false); + pushStopButton.setIcon(new ImageIcon(getClass().getResource("/icon/suspend.png"))); + pushStopButton.setText("停止"); + pushControlPanel.add(pushStopButton, new GridConstraints(0, 8, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushStartButton = new JButton(); + pushStartButton.setIcon(new ImageIcon(getClass().getResource("/icon/run@2x.png"))); + pushStartButton.setText("开始"); + pushControlPanel.add(pushStartButton, new GridConstraints(0, 9, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + dryRunCheckBox = new JCheckBox(); + dryRunCheckBox.setText("空跑"); + dryRunCheckBox.setToolTipText("空跑勾选时不会真实发送消息"); + pushControlPanel.add(dryRunCheckBox, new GridConstraints(0, 6, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + pushControlPanel.add(spacer1, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + threadCountSlider = new JSlider(); + threadCountSlider.setDoubleBuffered(true); + threadCountSlider.setExtent(0); + threadCountSlider.setFocusCycleRoot(false); + threadCountSlider.setFocusTraversalPolicyProvider(false); + threadCountSlider.setFocusable(false); + threadCountSlider.setInverted(false); + threadCountSlider.setMajorTickSpacing(10); + threadCountSlider.setMinimum(1); + threadCountSlider.setMinorTickSpacing(5); + threadCountSlider.setOpaque(false); + threadCountSlider.setOrientation(0); + threadCountSlider.setPaintLabels(false); + threadCountSlider.setPaintTicks(true); + threadCountSlider.setPaintTrack(true); + threadCountSlider.setRequestFocusEnabled(false); + threadCountSlider.setSnapToTicks(false); + threadCountSlider.setValueIsAdjusting(false); + pushControlPanel.add(threadCountSlider, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushCenterPanel = new JPanel(); + pushCenterPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + pushPanel.add(pushCenterPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JScrollPane scrollPane1 = new JScrollPane(); + pushCenterPanel.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + pushConsoleTextArea = new JTextArea(); + scrollPane1.setViewportView(pushConsoleTextArea); + final JScrollPane scrollPane2 = new JScrollPane(); + pushCenterPanel.add(scrollPane2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + pushThreadTable = new JTable(); + pushThreadTable.setGridColor(new Color(-12236470)); + pushThreadTable.setRowHeight(40); + pushThreadTable.setShowVerticalLines(false); + scrollPane2.setViewportView(pushThreadTable); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + } + +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/PushHisForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/PushHisForm.form new file mode 100644 index 00000000..3ddaca16 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/PushHisForm.form @@ -0,0 +1,171 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/PushHisForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/PushHisForm.java new file mode 100644 index 00000000..1d2f073c --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/PushHisForm.java @@ -0,0 +1,150 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.dao.TPushHistoryMapper; +import com.fangxuele.tool.push.domain.TPushHistory; +import com.fangxuele.tool.push.ui.Init; +import com.fangxuele.tool.push.util.JTableUtil; +import com.fangxuele.tool.push.util.MybatisUtil; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; + +import javax.swing.*; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import java.awt.*; +import java.util.List; + +/** + *
+ * PushHisForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class PushHisForm { + private JPanel pushHisPanel; + private JButton pushHisLeftDeleteButton; + private JButton pushHisExportButton; + private JTable pushHisLeftTable; + private JLabel pushHisCountLabel; + private JButton pushHisCopyButton; + private JTextArea pushHisTextArea; + private JButton resendFromHisButton; + + public static PushHisForm pushHisForm = new PushHisForm(); + + private static TPushHistoryMapper pushHistoryMapper = MybatisUtil.getSqlSession().getMapper(TPushHistoryMapper.class); + + /** + * 初始化推送历史tab + */ + public static void init() { + // 导入历史管理 + String[] headerNames = {"消息名称", "状态", "时间", "id"}; + DefaultTableModel model = new DefaultTableModel(null, headerNames); + pushHisForm.getPushHisLeftTable().setModel(model); + + DefaultTableCellRenderer hr = (DefaultTableCellRenderer) pushHisForm.getPushHisLeftTable().getTableHeader() + .getDefaultRenderer(); + // 表头列名居左 + hr.setHorizontalAlignment(DefaultTableCellRenderer.LEFT); + + List pushHistoryList = pushHistoryMapper.selectByMsgType(Init.config.getMsgType()); + Object[] data; + for (TPushHistory tPushHistory : pushHistoryList) { + data = new Object[4]; + data[0] = tPushHistory.getMsgName(); + data[1] = tPushHistory.getResult(); + data[2] = tPushHistory.getCreateTime(); + data[3] = tPushHistory.getId(); + model.addRow(data); + } + + // 隐藏id列 + JTableUtil.hideColumn(pushHisForm.getPushHisLeftTable(), 3); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + pushHisPanel = new JPanel(); + pushHisPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + panel1.add(pushHisPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final JSplitPane splitPane1 = new JSplitPane(); + splitPane1.setContinuousLayout(true); + splitPane1.setDividerSize(4); + splitPane1.setDoubleBuffered(true); + splitPane1.setResizeWeight(0.0); + pushHisPanel.add(splitPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + panel2.setMinimumSize(new Dimension(100, 24)); + panel2.setPreferredSize(new Dimension(740, 24)); + splitPane1.setLeftComponent(panel2); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(1, 4, new Insets(0, 10, 0, 0), -1, -1)); + panel2.add(panel3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel3.add(spacer1, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + pushHisLeftDeleteButton = new JButton(); + pushHisLeftDeleteButton.setIcon(new ImageIcon(getClass().getResource("/icon/remove.png"))); + pushHisLeftDeleteButton.setText("删除"); + panel3.add(pushHisLeftDeleteButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushHisExportButton = new JButton(); + pushHisExportButton.setIcon(new ImageIcon(getClass().getResource("/icon/export_dark.png"))); + pushHisExportButton.setText("导出"); + panel3.add(pushHisExportButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + resendFromHisButton = new JButton(); + resendFromHisButton.setIcon(new ImageIcon(getClass().getResource("/icon/refresh.png"))); + resendFromHisButton.setText("重发"); + panel3.add(resendFromHisButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JScrollPane scrollPane1 = new JScrollPane(); + panel2.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + pushHisLeftTable = new JTable(); + pushHisLeftTable.setAlignmentX(0.5f); + pushHisLeftTable.setAutoResizeMode(2); + pushHisLeftTable.setDoubleBuffered(true); + pushHisLeftTable.setGridColor(new Color(-12236470)); + pushHisLeftTable.setIntercellSpacing(new Dimension(1, 1)); + pushHisLeftTable.setRowHeight(46); + pushHisLeftTable.setShowVerticalLines(false); + scrollPane1.setViewportView(pushHisLeftTable); + final JPanel panel4 = new JPanel(); + panel4.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + splitPane1.setRightComponent(panel4); + final JPanel panel5 = new JPanel(); + panel5.setLayout(new GridLayoutManager(1, 4, new Insets(0, 10, 0, 10), -1, -1)); + panel4.add(panel5, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + panel5.add(spacer2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + pushHisCountLabel = new JLabel(); + pushHisCountLabel.setText(""); + panel5.add(pushHisCountLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + pushHisCopyButton = new JButton(); + pushHisCopyButton.setText("复制"); + panel5.add(pushHisCopyButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JScrollPane scrollPane2 = new JScrollPane(); + panel4.add(scrollPane2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + pushHisTextArea = new JTextArea(); + pushHisTextArea.setEditable(false); + scrollPane2.setViewportView(pushHisTextArea); + } +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/ScheduleForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/ScheduleForm.form new file mode 100644 index 00000000..1d35af7c --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/ScheduleForm.form @@ -0,0 +1,149 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/ScheduleForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/ScheduleForm.java new file mode 100644 index 00000000..05b0cf46 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/ScheduleForm.java @@ -0,0 +1,124 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.ui.Init; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; + +import javax.swing.*; +import java.awt.*; + +/** + *
+ * ScheduleForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class ScheduleForm { + private JPanel schedulePanel; + private JRadioButton runAtThisTimeRadioButton; + private JTextField startAtThisTimeTextField; + private JRadioButton runPerDayRadioButton; + private JTextField startPerDayTextField; + private JRadioButton runPerWeekRadioButton; + private JButton scheduleSaveButton; + private JComboBox schedulePerWeekComboBox; + private JTextField startPerWeekTextField; + + public static ScheduleForm scheduleForm = new ScheduleForm(); + + /** + * 初始化计划任务tab + */ + public static void init() { + // 开始 + ScheduleForm.scheduleForm.getRunAtThisTimeRadioButton().setSelected(Init.config.isRadioStartAt()); + ScheduleForm.scheduleForm.getStartAtThisTimeTextField().setText(Init.config.getTextStartAt()); + + //每天 + ScheduleForm.scheduleForm.getRunPerDayRadioButton().setSelected(Init.config.isRadioPerDay()); + ScheduleForm.scheduleForm.getStartPerDayTextField().setText(Init.config.getTextPerDay()); + + // 每周 + ScheduleForm.scheduleForm.getRunPerWeekRadioButton().setSelected(Init.config.isRadioPerWeek()); + ScheduleForm.scheduleForm.getSchedulePerWeekComboBox().setSelectedItem(Init.config.getTextPerWeekWeek()); + ScheduleForm.scheduleForm.getStartPerWeekTextField().setText(Init.config.getTextPerWeekTime()); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + schedulePanel = new JPanel(); + schedulePanel.setLayout(new GridLayoutManager(5, 7, new Insets(10, 10, 10, 10), -1, -1)); + panel1.add(schedulePanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + runAtThisTimeRadioButton = new JRadioButton(); + runAtThisTimeRadioButton.setText("在此时间开始推送:"); + schedulePanel.add(runAtThisTimeRadioButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + schedulePanel.add(spacer1, new GridConstraints(0, 6, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + schedulePanel.add(spacer2, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + startAtThisTimeTextField = new JTextField(); + startAtThisTimeTextField.setText(""); + schedulePanel.add(startAtThisTimeTextField, new GridConstraints(0, 1, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + runPerDayRadioButton = new JRadioButton(); + runPerDayRadioButton.setText("每天固定时间开始推送:"); + schedulePanel.add(runPerDayRadioButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + startPerDayTextField = new JTextField(); + schedulePanel.add(startPerDayTextField, new GridConstraints(1, 1, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + runPerWeekRadioButton = new JRadioButton(); + runPerWeekRadioButton.setText("每周固定时间开始推送:"); + schedulePanel.add(runPerWeekRadioButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setText("yyyy-MM-dd HH:mm:ss"); + schedulePanel.add(label1, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label2 = new JLabel(); + label2.setText("HH:mm:ss"); + schedulePanel.add(label2, new GridConstraints(1, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label3 = new JLabel(); + label3.setText("HH:mm:ss"); + schedulePanel.add(label3, new GridConstraints(2, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + scheduleSaveButton = new JButton(); + scheduleSaveButton.setHorizontalAlignment(0); + scheduleSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + scheduleSaveButton.setText("保存"); + schedulePanel.add(scheduleSaveButton, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label4 = new JLabel(); + label4.setText("每周"); + schedulePanel.add(label4, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label5 = new JLabel(); + label5.setText("的"); + schedulePanel.add(label5, new GridConstraints(2, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + schedulePerWeekComboBox = new JComboBox(); + final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel(); + defaultComboBoxModel1.addElement("一"); + defaultComboBoxModel1.addElement("二"); + defaultComboBoxModel1.addElement("三"); + defaultComboBoxModel1.addElement("四"); + defaultComboBoxModel1.addElement("五"); + defaultComboBoxModel1.addElement("六"); + defaultComboBoxModel1.addElement("日"); + schedulePerWeekComboBox.setModel(defaultComboBoxModel1); + schedulePanel.add(schedulePerWeekComboBox, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + startPerWeekTextField = new JTextField(); + schedulePanel.add(startPerWeekTextField, new GridConstraints(2, 4, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + } +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/SettingForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/SettingForm.form new file mode 100644 index 00000000..694dc81f --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/SettingForm.form @@ -0,0 +1,903 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/SettingForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/SettingForm.java new file mode 100644 index 00000000..a3c5885b --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/SettingForm.java @@ -0,0 +1,481 @@ +package com.fangxuele.tool.push.ui.form; + +import com.fangxuele.tool.push.ui.Init; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import java.awt.*; + +/** + *
+ * SettingForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +public class SettingForm { + private JPanel settingPanel; + private JScrollPane settingScrollPane; + private JTextField wechatAppIdTextField; + private JPasswordField wechatAppSecretPasswordField; + private JPasswordField wechatTokenPasswordField; + private JPasswordField wechatAesKeyPasswordField; + private JButton settingMpInfoSaveButton; + private JTextField mysqlUrlTextField; + private JTextField mysqlDatabaseTextField; + private JTextField mysqlUserTextField; + private JPasswordField mysqlPasswordField; + private JButton settingTestDbLinkButton; + private JButton settingDbInfoSaveButton; + private JTextField aliServerUrlTextField; + private JPasswordField aliAppKeyPasswordField; + private JTextField aliSignTextField; + private JPasswordField aliAppSecretPasswordField; + private JButton settingAliInfoSaveButton; + private JComboBox settingThemeComboBox; + private JComboBox settingFontNameComboBox; + private JComboBox settingFontSizeComboBox; + private JButton settingAppearanceSaveButton; + private JCheckBox autoCheckUpdateCheckBox; + private JTextField aliyunSignTextField; + private JPasswordField aliyunAccessKeySecretTextField; + private JButton settingAliyunSaveButton; + private JTextField aliyunAccessKeyIdTextField; + private JTextField miniAppAppIdTextField; + private JPasswordField miniAppAppSecretPasswordField; + private JPasswordField miniAppTokenPasswordField; + private JPasswordField miniAppAesKeyPasswordField; + private JButton settingMaInfoSaveButton; + private JTextField txyunSignTextField; + private JPasswordField txyunAppKeyTextField; + private JButton settingTxyunSaveButton; + private JTextField txyunAppIdTextField; + private JPasswordField yunpianApiKeyTextField; + private JButton settingYunpianSaveButton; + + public static SettingForm settingForm = new SettingForm(); + + /** + * 初始化设置tab + */ + public static void init() { + // 常规 + settingForm.getAutoCheckUpdateCheckBox().setSelected(Init.config.isAutoCheckUpdate()); + + // 微信公众号 + settingForm.getWechatAppIdTextField().setText(Init.config.getWechatAppId()); + settingForm.getWechatAppSecretPasswordField().setText(Init.config.getWechatAppSecret()); + settingForm.getWechatTokenPasswordField().setText(Init.config.getWechatToken()); + settingForm.getWechatAesKeyPasswordField().setText(Init.config.getWechatAesKey()); + + // 微信小程序 + settingForm.getMiniAppAppIdTextField().setText(Init.config.getMiniAppAppId()); + settingForm.getMiniAppAppSecretPasswordField().setText(Init.config.getMiniAppAppSecret()); + settingForm.getMiniAppTokenPasswordField().setText(Init.config.getMiniAppToken()); + settingForm.getMiniAppAesKeyPasswordField().setText(Init.config.getMiniAppAesKey()); + + // 阿里云短信 + settingForm.getAliyunAccessKeyIdTextField().setText(Init.config.getAliyunAccessKeyId()); + settingForm.getAliyunAccessKeySecretTextField().setText(Init.config.getAliyunAccessKeySecret()); + settingForm.getAliyunSignTextField().setText(Init.config.getAliyunSign()); + + // 阿里大于 + settingForm.getAliServerUrlTextField().setText(Init.config.getAliServerUrl()); + settingForm.getAliAppKeyPasswordField().setText(Init.config.getAliAppKey()); + settingForm.getAliAppSecretPasswordField().setText(Init.config.getAliAppSecret()); + settingForm.getAliSignTextField().setText(Init.config.getAliSign()); + + // 腾讯云短信 + settingForm.getTxyunAppIdTextField().setText(Init.config.getTxyunAppId()); + settingForm.getTxyunAppKeyTextField().setText(Init.config.getTxyunAppKey()); + settingForm.getTxyunSignTextField().setText(Init.config.getTxyunSign()); + + // 云片网短信 + settingForm.getYunpianApiKeyTextField().setText(Init.config.getYunpianApiKey()); + + // MySQL + settingForm.getMysqlUrlTextField().setText(Init.config.getMysqlUrl()); + settingForm.getMysqlDatabaseTextField().setText(Init.config.getMysqlDatabase()); + settingForm.getMysqlUserTextField().setText(Init.config.getMysqlUser()); + settingForm.getMysqlPasswordField().setText(Init.config.getMysqlPassword()); + + // 外观 + settingForm.getSettingThemeComboBox().setSelectedItem(Init.config.getTheme()); + settingForm.getSettingFontNameComboBox().setSelectedItem(Init.config.getFont()); + settingForm.getSettingFontSizeComboBox().setSelectedItem(String.valueOf(Init.config.getFontSize())); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + settingPanel = new JPanel(); + settingPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + Font settingPanelFont = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, settingPanel.getFont()); + if (settingPanelFont != null) settingPanel.setFont(settingPanelFont); + panel1.add(settingPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingScrollPane = new JScrollPane(); + settingPanel.add(settingScrollPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(10, 1, new Insets(10, 10, 10, 10), -1, -1)); + settingScrollPane.setViewportView(panel2); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(6, 3, new Insets(15, 15, 10, 0), -1, -1)); + Font panel3Font = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, panel3.getFont()); + if (panel3Font != null) panel3.setFont(panel3Font); + panel2.add(panel3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "微信公众号", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel3.getFont()))); + final JLabel label1 = new JLabel(); + label1.setText("AppID"); + panel3.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel3.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + panel3.add(spacer2, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + wechatAppIdTextField = new JTextField(); + panel3.add(wechatAppIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label2 = new JLabel(); + label2.setText("AppSecret"); + panel3.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + wechatAppSecretPasswordField = new JPasswordField(); + panel3.add(wechatAppSecretPasswordField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label3 = new JLabel(); + label3.setText("Token"); + panel3.add(label3, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + wechatTokenPasswordField = new JPasswordField(); + panel3.add(wechatTokenPasswordField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label4 = new JLabel(); + label4.setText("AES Key"); + panel3.add(label4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + wechatAesKeyPasswordField = new JPasswordField(); + panel3.add(wechatAesKeyPasswordField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel4 = new JPanel(); + panel4.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel3.add(panel4, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingMpInfoSaveButton = new JButton(); + settingMpInfoSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingMpInfoSaveButton.setText("保存"); + panel4.add(settingMpInfoSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer3 = new Spacer(); + panel4.add(spacer3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer4 = new Spacer(); + panel2.add(spacer4, new GridConstraints(9, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JPanel panel5 = new JPanel(); + panel5.setLayout(new GridLayoutManager(6, 4, new Insets(15, 15, 10, 0), -1, -1)); + panel2.add(panel5, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel5.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "MySQL数据库", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel5.getFont()))); + final JLabel label5 = new JLabel(); + label5.setText("数据库地址"); + panel5.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer5 = new Spacer(); + panel5.add(spacer5, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer6 = new Spacer(); + panel5.add(spacer6, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + mysqlUrlTextField = new JTextField(); + panel5.add(mysqlUrlTextField, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label6 = new JLabel(); + label6.setText("数据库名称"); + panel5.add(label6, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mysqlDatabaseTextField = new JTextField(); + panel5.add(mysqlDatabaseTextField, new GridConstraints(1, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label7 = new JLabel(); + label7.setText("用户名"); + panel5.add(label7, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mysqlUserTextField = new JTextField(); + panel5.add(mysqlUserTextField, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label8 = new JLabel(); + label8.setText("密码"); + panel5.add(label8, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mysqlPasswordField = new JPasswordField(); + panel5.add(mysqlPasswordField, new GridConstraints(3, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel6 = new JPanel(); + panel6.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); + panel5.add(panel6, new GridConstraints(4, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingTestDbLinkButton = new JButton(); + settingTestDbLinkButton.setIcon(new ImageIcon(getClass().getResource("/icon/arrow_right.png"))); + settingTestDbLinkButton.setText("测试连接"); + panel6.add(settingTestDbLinkButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer7 = new Spacer(); + panel6.add(spacer7, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + settingDbInfoSaveButton = new JButton(); + settingDbInfoSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingDbInfoSaveButton.setText("保存"); + panel6.add(settingDbInfoSaveButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel7 = new JPanel(); + panel7.setLayout(new GridLayoutManager(6, 3, new Insets(15, 15, 10, 0), -1, -1)); + panel2.add(panel7, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel7.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "阿里大于短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel7.getFont()))); + final JLabel label9 = new JLabel(); + label9.setText("SMS ServerUrl"); + panel7.add(label9, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer8 = new Spacer(); + panel7.add(spacer8, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer9 = new Spacer(); + panel7.add(spacer9, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + aliServerUrlTextField = new JTextField(); + panel7.add(aliServerUrlTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label10 = new JLabel(); + label10.setText("AppKey"); + panel7.add(label10, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + aliAppKeyPasswordField = new JPasswordField(); + panel7.add(aliAppKeyPasswordField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label11 = new JLabel(); + label11.setText("AppSecret"); + panel7.add(label11, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label12 = new JLabel(); + label12.setText("短信签名"); + panel7.add(label12, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + aliSignTextField = new JTextField(); + panel7.add(aliSignTextField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + aliAppSecretPasswordField = new JPasswordField(); + panel7.add(aliAppSecretPasswordField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel8 = new JPanel(); + panel8.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel7.add(panel8, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingAliInfoSaveButton = new JButton(); + settingAliInfoSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingAliInfoSaveButton.setText("保存"); + panel8.add(settingAliInfoSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer10 = new Spacer(); + panel8.add(spacer10, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final JPanel panel9 = new JPanel(); + panel9.setLayout(new GridLayoutManager(4, 3, new Insets(15, 15, 10, 0), -1, -1)); + panel2.add(panel9, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel9.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "外观", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel9.getFont()))); + final JLabel label13 = new JLabel(); + label13.setText("主题风格"); + panel9.add(label13, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer11 = new Spacer(); + panel9.add(spacer11, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + settingThemeComboBox = new JComboBox(); + final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel(); + defaultComboBoxModel1.addElement("Darcula(推荐)"); + defaultComboBoxModel1.addElement("BeautyEye"); + defaultComboBoxModel1.addElement("系统默认"); + defaultComboBoxModel1.addElement("weblaf"); + settingThemeComboBox.setModel(defaultComboBoxModel1); + panel9.add(settingThemeComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label14 = new JLabel(); + label14.setText("字体"); + panel9.add(label14, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + settingFontNameComboBox = new JComboBox(); + final DefaultComboBoxModel defaultComboBoxModel2 = new DefaultComboBoxModel(); + defaultComboBoxModel2.addElement("Microsoft YaHei"); + defaultComboBoxModel2.addElement("Microsoft YaHei Light"); + defaultComboBoxModel2.addElement("Microsoft YaHei UI"); + defaultComboBoxModel2.addElement("Microsoft YaHei UI Light"); + settingFontNameComboBox.setModel(defaultComboBoxModel2); + panel9.add(settingFontNameComboBox, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label15 = new JLabel(); + label15.setText("字号"); + panel9.add(label15, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + settingFontSizeComboBox = new JComboBox(); + final DefaultComboBoxModel defaultComboBoxModel3 = new DefaultComboBoxModel(); + defaultComboBoxModel3.addElement("10"); + defaultComboBoxModel3.addElement("11"); + defaultComboBoxModel3.addElement("12"); + defaultComboBoxModel3.addElement("13"); + defaultComboBoxModel3.addElement("14"); + defaultComboBoxModel3.addElement("15"); + defaultComboBoxModel3.addElement("16"); + defaultComboBoxModel3.addElement("17"); + defaultComboBoxModel3.addElement("18"); + defaultComboBoxModel3.addElement("19"); + defaultComboBoxModel3.addElement("20"); + defaultComboBoxModel3.addElement("21"); + defaultComboBoxModel3.addElement("22"); + defaultComboBoxModel3.addElement("23"); + defaultComboBoxModel3.addElement("24"); + defaultComboBoxModel3.addElement("25"); + defaultComboBoxModel3.addElement("26"); + settingFontSizeComboBox.setModel(defaultComboBoxModel3); + panel9.add(settingFontSizeComboBox, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel10 = new JPanel(); + panel10.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel9.add(panel10, new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingAppearanceSaveButton = new JButton(); + settingAppearanceSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingAppearanceSaveButton.setText("保存"); + panel10.add(settingAppearanceSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer12 = new Spacer(); + panel10.add(spacer12, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final JPanel panel11 = new JPanel(); + panel11.setLayout(new GridLayoutManager(2, 2, new Insets(15, 15, 10, 0), -1, -1)); + panel2.add(panel11, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel11.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "常规", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel11.getFont()))); + autoCheckUpdateCheckBox = new JCheckBox(); + autoCheckUpdateCheckBox.setText("启动时自动检查更新"); + panel11.add(autoCheckUpdateCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer13 = new Spacer(); + panel11.add(spacer13, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer14 = new Spacer(); + panel11.add(spacer14, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JPanel panel12 = new JPanel(); + panel12.setLayout(new GridLayoutManager(5, 4, new Insets(15, 15, 10, 0), -1, -1)); + panel2.add(panel12, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel12.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "阿里云短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel12.getFont()))); + final Spacer spacer15 = new Spacer(); + panel12.add(spacer15, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JLabel label16 = new JLabel(); + label16.setText("AccessKeyId"); + panel12.add(label16, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label17 = new JLabel(); + label17.setText("AccessKeySecret"); + panel12.add(label17, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label18 = new JLabel(); + label18.setText("短信签名"); + panel12.add(label18, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + aliyunSignTextField = new JTextField(); + panel12.add(aliyunSignTextField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + aliyunAccessKeySecretTextField = new JPasswordField(); + panel12.add(aliyunAccessKeySecretTextField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel13 = new JPanel(); + panel13.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel12.add(panel13, new GridConstraints(3, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingAliyunSaveButton = new JButton(); + settingAliyunSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingAliyunSaveButton.setText("保存"); + panel13.add(settingAliyunSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer16 = new Spacer(); + panel13.add(spacer16, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer17 = new Spacer(); + panel12.add(spacer17, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + aliyunAccessKeyIdTextField = new JTextField(); + panel12.add(aliyunAccessKeyIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel14 = new JPanel(); + panel14.setLayout(new GridLayoutManager(6, 3, new Insets(15, 15, 10, 0), -1, -1)); + Font panel14Font = this.$$$getFont$$$("Microsoft YaHei UI", -1, -1, panel14.getFont()); + if (panel14Font != null) panel14.setFont(panel14Font); + panel2.add(panel14, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel14.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "微信小程序", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel14.getFont()))); + final JLabel label19 = new JLabel(); + label19.setText("AppID"); + panel14.add(label19, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer18 = new Spacer(); + panel14.add(spacer18, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer19 = new Spacer(); + panel14.add(spacer19, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + miniAppAppIdTextField = new JTextField(); + panel14.add(miniAppAppIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label20 = new JLabel(); + label20.setText("AppSecret"); + panel14.add(label20, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + miniAppAppSecretPasswordField = new JPasswordField(); + panel14.add(miniAppAppSecretPasswordField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label21 = new JLabel(); + label21.setText("Token"); + panel14.add(label21, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + miniAppTokenPasswordField = new JPasswordField(); + miniAppTokenPasswordField.setText(""); + panel14.add(miniAppTokenPasswordField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JLabel label22 = new JLabel(); + label22.setText("AES Key"); + panel14.add(label22, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + miniAppAesKeyPasswordField = new JPasswordField(); + panel14.add(miniAppAesKeyPasswordField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel15 = new JPanel(); + panel15.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel14.add(panel15, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingMaInfoSaveButton = new JButton(); + settingMaInfoSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingMaInfoSaveButton.setText("保存"); + panel15.add(settingMaInfoSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer20 = new Spacer(); + panel15.add(spacer20, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final JPanel panel16 = new JPanel(); + panel16.setLayout(new GridLayoutManager(5, 4, new Insets(15, 15, 10, 0), -1, -1)); + panel2.add(panel16, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel16.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "腾讯云短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel16.getFont()))); + final Spacer spacer21 = new Spacer(); + panel16.add(spacer21, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JLabel label23 = new JLabel(); + label23.setText("AppId"); + panel16.add(label23, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label24 = new JLabel(); + label24.setText("AppKey"); + panel16.add(label24, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label25 = new JLabel(); + label25.setText("短信签名"); + panel16.add(label25, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + txyunSignTextField = new JTextField(); + panel16.add(txyunSignTextField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + txyunAppKeyTextField = new JPasswordField(); + txyunAppKeyTextField.setText(""); + panel16.add(txyunAppKeyTextField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel17 = new JPanel(); + panel17.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel16.add(panel17, new GridConstraints(3, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingTxyunSaveButton = new JButton(); + settingTxyunSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingTxyunSaveButton.setText("保存"); + panel17.add(settingTxyunSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer22 = new Spacer(); + panel17.add(spacer22, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer23 = new Spacer(); + panel16.add(spacer23, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + txyunAppIdTextField = new JTextField(); + panel16.add(txyunAppIdTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel18 = new JPanel(); + panel18.setLayout(new GridLayoutManager(3, 4, new Insets(15, 15, 10, 0), -1, -1)); + panel2.add(panel18, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + panel18.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "云片网短信", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel18.getFont()))); + final Spacer spacer24 = new Spacer(); + panel18.add(spacer24, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JLabel label26 = new JLabel(); + label26.setText("ApiKey"); + panel18.add(label26, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + yunpianApiKeyTextField = new JPasswordField(); + yunpianApiKeyTextField.setText(""); + panel18.add(yunpianApiKeyTextField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); + final JPanel panel19 = new JPanel(); + panel19.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); + panel18.add(panel19, new GridConstraints(1, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + settingYunpianSaveButton = new JButton(); + settingYunpianSaveButton.setIcon(new ImageIcon(getClass().getResource("/icon/menu-saveall_dark.png"))); + settingYunpianSaveButton.setText("保存"); + panel19.add(settingYunpianSaveButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer25 = new Spacer(); + panel19.add(spacer25, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer26 = new Spacer(); + panel18.add(spacer26, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + } + +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/UserCaseForm.form b/src/main/java/com/fangxuele/tool/push/ui/form/UserCaseForm.form new file mode 100644 index 00000000..55cf214e --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/UserCaseForm.form @@ -0,0 +1,80 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/fangxuele/tool/push/ui/form/UserCaseForm.java b/src/main/java/com/fangxuele/tool/push/ui/form/UserCaseForm.java new file mode 100644 index 00000000..d14db8cf --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/ui/form/UserCaseForm.java @@ -0,0 +1,157 @@ +package com.fangxuele.tool.push.ui.form; + +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; +import com.fangxuele.tool.push.bean.UserCase; +import com.fangxuele.tool.push.ui.Init; +import com.fangxuele.tool.push.ui.UiConsts; +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.net.URL; +import java.util.List; + +/** + *
+ * UserCaseForm
+ * 
+ * + * @author RememBerBer + * @since 2019/5/6. + */ +@Getter +@Slf4j +public class UserCaseForm { + private JPanel userCasePanel; + private JScrollPane userCaseScrollPane; + private JPanel userCaseListPanel; + + public static UserCaseForm userCaseForm = new UserCaseForm(); + + /** + * 初始化他们都在用tab + */ + public static void init() { + // 从github获取用户案例相关信息 + String userCaseInfoContent = HttpUtil.get(UiConsts.USER_CASE_URL); + if (StringUtils.isNotEmpty(userCaseInfoContent)) { + List userCaseInfoList = JSONUtil.toList(JSONUtil.parseArray(userCaseInfoContent), UserCase.class); + + JPanel userCaseListPanel = userCaseForm.getUserCaseListPanel(); + int listSize = userCaseInfoList.size(); + userCaseListPanel.setLayout(new GridLayoutManager((int) Math.ceil(listSize / 2.0) + 1, 3, new Insets(0, 0, 0, 0), -1, -1)); + for (int i = 0; i < listSize; i++) { + UserCase userCase = userCaseInfoList.get(i); + JPanel userCasePanel = new JPanel(); + userCasePanel.setLayout(new GridLayoutManager(2, 2, new Insets(10, 10, 0, 0), -1, -1)); + + JLabel qrCodeLabel = new JLabel(); + try { + URL url = new URL(userCase.getQrCodeUrl()); + BufferedImage image = ImageIO.read(url); + qrCodeLabel.setIcon(new ImageIcon(image)); + } catch (IOException e) { + e.printStackTrace(); + log.error("从github获取用户案例相关信息失败", e); + } + JLabel titleLabel = new JLabel(); + titleLabel.setText(userCase.getTitle()); + Font fnt = new Font(Init.config.getFont(), Font.BOLD, 20); + titleLabel.setFont(fnt); + JLabel descLabel = new JLabel(); + descLabel.setText(userCase.getDesc()); + + userCasePanel.add(qrCodeLabel, new GridConstraints(0, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + userCasePanel.add(titleLabel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + userCasePanel.add(descLabel, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + userCaseListPanel.add(userCasePanel, new GridConstraints(i / 2, i % 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + final Spacer spacer1 = new Spacer(); + userCaseListPanel.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + userCaseListPanel.add(spacer2, new GridConstraints((int) Math.ceil(listSize / 2.0), 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + + userCaseListPanel.updateUI(); + } + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + userCasePanel = new JPanel(); + userCasePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + userCaseScrollPane = new JScrollPane(); + userCasePanel.add(userCaseScrollPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + userCaseListPanel = new JPanel(); + userCaseListPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + userCaseScrollPane.setViewportView(userCaseListPanel); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(5, 1, new Insets(10, 10, 0, 0), -1, -1)); + userCasePanel.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + final JLabel label1 = new JLabel(); + label1.setText("产品信息将会在这里展示,帮助宣传您的产品"); + panel1.add(label1, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label2 = new JLabel(); + Font label2Font = this.$$$getFont$$$(null, Font.BOLD, -1, label2.getFont()); + if (label2Font != null) label2.setFont(label2Font); + label2.setText("WePush不会收集用户的任何信息"); + panel1.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label3 = new JLabel(); + label3.setText("也正因如此,我无法得知哪些优秀的企业或个人在使用WePush"); + panel1.add(label3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label4 = new JLabel(); + label4.setText("如果WePush能给您带来一些便利"); + panel1.add(label4, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label5 = new JLabel(); + label5.setText("欢迎将您的产品邮件告诉我:rememberber@163.com"); + panel1.add(label5, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return userCasePanel; + } +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/frame/MainFrame.java b/src/main/java/com/fangxuele/tool/push/ui/frame/MainFrame.java index 2b27c03d..d04d7ca1 100644 --- a/src/main/java/com/fangxuele/tool/push/ui/frame/MainFrame.java +++ b/src/main/java/com/fangxuele/tool/push/ui/frame/MainFrame.java @@ -6,6 +6,7 @@ import com.fangxuele.tool.push.ui.listener.FramListener; import com.fangxuele.tool.push.ui.listener.HelpListener; import com.fangxuele.tool.push.ui.listener.MemberListener; +import com.fangxuele.tool.push.ui.listener.MessageTypeListener; import com.fangxuele.tool.push.ui.listener.MsgListener; import com.fangxuele.tool.push.ui.listener.PushHisListener; import com.fangxuele.tool.push.ui.listener.PushListener; @@ -38,11 +39,11 @@ public void init() { //得到屏幕的尺寸 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - this.setBounds((int) (screenSize.width * 0.1), (int) (screenSize.height * 0.08), (int) (screenSize.width * 0.8), - (int) (screenSize.height * 0.8)); + this.setBounds((int) (screenSize.width * 0.1), (int) (screenSize.height * 0.06), (int) (screenSize.width * 0.8), + (int) (screenSize.height * 0.83)); Dimension preferSize = new Dimension((int) (screenSize.width * 0.8), - (int) (screenSize.height * 0.8)); + (int) (screenSize.height * 0.83)); this.setPreferredSize(preferSize); } @@ -50,6 +51,7 @@ public void init() { * 添加事件监听 */ public void addListeners() { + MessageTypeListener.addListeners(); AboutListener.addListeners(); HelpListener.addListeners(); PushHisListener.addListeners(); diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/AboutListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/AboutListener.java index 9e008feb..6ac38f01 100644 --- a/src/main/java/com/fangxuele/tool/push/ui/listener/AboutListener.java +++ b/src/main/java/com/fangxuele/tool/push/ui/listener/AboutListener.java @@ -8,7 +8,10 @@ import com.alibaba.fastjson.JSON; import com.fangxuele.tool.push.bean.VersionSummary; import com.fangxuele.tool.push.ui.UiConsts; +import com.fangxuele.tool.push.ui.dialog.UpdateDialog; +import com.fangxuele.tool.push.ui.form.AboutForm; import com.fangxuele.tool.push.ui.form.MainWindow; +import com.fangxuele.tool.push.util.SystemUtil; import org.apache.commons.lang3.StringUtils; import javax.imageio.ImageIO; @@ -36,7 +39,7 @@ public class AboutListener { private static final Log logger = LogFactory.get(); public static void addListeners() { - MainWindow.mainWindow.getCompanyLabel().addMouseListener(new MouseAdapter() { + AboutForm.aboutForm.getCompanyLabel().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { super.mouseClicked(e); @@ -51,13 +54,13 @@ public void mouseClicked(MouseEvent e) { @Override public void mouseEntered(MouseEvent e) { super.mouseEntered(e); - MainWindow.mainWindow.getCompanyLabel().setCursor(new Cursor(Cursor.HAND_CURSOR)); + AboutForm.aboutForm.getCompanyLabel().setCursor(new Cursor(Cursor.HAND_CURSOR)); } }); // 检查更新 - MainWindow.mainWindow.getCheckUpdateLabel().addMouseListener(new MouseAdapter() { + AboutForm.aboutForm.getCheckUpdateLabel().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { super.mouseClicked(e); @@ -67,65 +70,96 @@ public void mouseClicked(MouseEvent e) { @Override public void mouseEntered(MouseEvent e) { super.mouseEntered(e); - MainWindow.mainWindow.getCheckUpdateLabel().setCursor(new Cursor(Cursor.HAND_CURSOR)); + AboutForm.aboutForm.getCheckUpdateLabel().setCursor(new Cursor(Cursor.HAND_CURSOR)); } }); - } - public static void checkUpdate(boolean initCheck) { - Desktop desktop = Desktop.getDesktop(); - try { - // 当前版本 - String currentVersion = UiConsts.APP_VERSION; - - // 从github获取最新版本相关信息 - String content = HttpUtil.get(UiConsts.CHECK_VERSION_URL); - if (StringUtils.isEmpty(content) && !initCheck) { - JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "检查超时,请关注GitHub Release!", "网络错误", - JOptionPane.INFORMATION_MESSAGE); - return; - } - content = content.replace("\n", ""); - - VersionSummary versionSummary = JSON.parseObject(content, VersionSummary.class); - // 最新版本 - String newVersion = versionSummary.getCurrentVersion(); - String versionIndex = versionSummary.getVersionIndex(); - // 版本索引 - Map versionIndexMap = JSON.parseObject(versionIndex, Map.class); - // 版本明细列表 - List versionDetailList = versionSummary.getVersionDetailList(); - - if (newVersion.compareTo(currentVersion) > 0) { - // 当前版本索引 - int currentVersionIndex = Integer.parseInt(versionIndexMap.get(currentVersion)); - // 版本更新日志: - StringBuilder versionLogBuilder = new StringBuilder("惊现新版本!立即下载?\n\n"); - VersionSummary.Version version; - for (int i = currentVersionIndex + 1; i < versionDetailList.size(); i++) { - version = versionDetailList.get(i); - versionLogBuilder.append(version.getVersion()).append("\n"); - versionLogBuilder.append(version.getTitle()).append("\n"); - versionLogBuilder.append(version.getLog()).append("\n"); + // 帮助文档 + AboutForm.aboutForm.getHelpDocLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/rememberber/WePush/wiki")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); } - String versionLog = versionLogBuilder.toString(); + } - int isPush = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getPushPanel(), - versionLog, "惊现新版本!立即下载?", - JOptionPane.YES_NO_OPTION); + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + AboutForm.aboutForm.getHelpDocLabel().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + } - if (isPush == JOptionPane.YES_OPTION) { - desktop.browse(new URI("https://github.com/rememberber/WePush/releases")); - } - } else { - if (!initCheck) { - JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "当前已经是最新版本!", "恭喜", - JOptionPane.INFORMATION_MESSAGE); + public static void checkUpdate(boolean initCheck) { + // 当前版本 + String currentVersion = UiConsts.APP_VERSION; + + // 从github获取最新版本相关信息 + String content = HttpUtil.get(UiConsts.CHECK_VERSION_URL); + if (StringUtils.isEmpty(content) && !initCheck) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "检查超时,请关注GitHub Release!", "网络错误", + JOptionPane.INFORMATION_MESSAGE); + return; + } + content = content.replace("\n", ""); + + VersionSummary versionSummary = JSON.parseObject(content, VersionSummary.class); + // 最新版本 + String newVersion = versionSummary.getCurrentVersion(); + String versionIndex = versionSummary.getVersionIndex(); + // 版本索引 + Map versionIndexMap = JSON.parseObject(versionIndex, Map.class); + // 版本明细列表 + List versionDetailList = versionSummary.getVersionDetailList(); + + if (newVersion.compareTo(currentVersion) > 0) { + // 当前版本索引 + int currentVersionIndex = Integer.parseInt(versionIndexMap.get(currentVersion)); + // 版本更新日志: + StringBuilder versionLogBuilder = new StringBuilder("惊现新版本!立即下载?\n\n"); + VersionSummary.Version version; + for (int i = currentVersionIndex + 1; i < versionDetailList.size(); i++) { + version = versionDetailList.get(i); + versionLogBuilder.append(version.getVersion()).append("\n"); + versionLogBuilder.append(version.getTitle()).append("\n"); + versionLogBuilder.append(version.getLog()).append("\n"); + } + String versionLog = versionLogBuilder.toString(); + + int downLoadNow = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getPushPanel(), + versionLog, "惊现新版本!立即下载?", + JOptionPane.YES_NO_OPTION); + + if (downLoadNow == JOptionPane.YES_OPTION) { + if (SystemUtil.isMacOs()) { + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/rememberber/WePush/releases")); + } catch (IOException | URISyntaxException ex) { + ex.printStackTrace(); + } + } else { + UpdateDialog dialog = new UpdateDialog(); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + dialog.setBounds(screenSize.width / 2 - 300, screenSize.height / 2 - 50, 600, 100); + + Dimension preferSize = new Dimension(600, 100); + dialog.setMaximumSize(preferSize); + dialog.pack(); + dialog.downLoad(newVersion); + dialog.setVisible(true); } } - - } catch (IOException | URISyntaxException e1) { - e1.printStackTrace(); + } else { + if (!initCheck) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "当前已经是最新版本!", "恭喜", + JOptionPane.INFORMATION_MESSAGE); + } } } @@ -136,7 +170,7 @@ public static void initQrCode() { String qrCodeContent = HttpUtil.get(UiConsts.QR_CODE_URL); if (StringUtils.isNotEmpty(qrCodeContent)) { Map urlMap = JSONUtil.toBean(qrCodeContent, Map.class); - JLabel qrCodeLabel = MainWindow.mainWindow.getQrCodeLabel(); + JLabel qrCodeLabel = AboutForm.aboutForm.getQrCodeLabel(); try { URL url = new URL(urlMap.get("url")); diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/FramListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/FramListener.java index c372df43..1d23c923 100644 --- a/src/main/java/com/fangxuele/tool/push/ui/listener/FramListener.java +++ b/src/main/java/com/fangxuele/tool/push/ui/listener/FramListener.java @@ -3,12 +3,15 @@ import cn.hutool.log.Log; import cn.hutool.log.LogFactory; import com.fangxuele.tool.push.App; -import com.fangxuele.tool.push.ui.form.MainWindow; import javax.swing.*; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; +import static com.fangxuele.tool.push.App.mainFrame; +import static com.fangxuele.tool.push.ui.form.MainWindow.mainWindow; +import static com.fangxuele.tool.push.ui.form.PushForm.pushForm; + /** *
  * 窗体事件监听
@@ -22,7 +25,7 @@ public class FramListener {
     private static final Log logger = LogFactory.get();
 
     public static void addListeners() {
-        App.mainFrame.addWindowListener(new WindowListener() {
+        mainFrame.addWindowListener(new WindowListener() {
 
             @Override
             public void windowOpened(WindowEvent e) {
@@ -50,11 +53,12 @@ public void windowDeactivated(WindowEvent e) {
 
             @Override
             public void windowClosing(WindowEvent e) {
-                if (!MainWindow.mainWindow.getPushStartButton().isEnabled()) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(),
+                if (!pushForm.getPushStartButton().isEnabled()) {
+                    JOptionPane.showMessageDialog(mainWindow.getPushPanel(),
                             "有推送任务正在进行!\n\n为避免数据丢失,请先停止!\n\n", "Sorry~", JOptionPane.WARNING_MESSAGE);
                 } else {
-                    App.mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                    App.sqlSession.close();
+                    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 }
 
             }
diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/HelpListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/HelpListener.java
index d25c8fcd..34e9b67b 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/listener/HelpListener.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/listener/HelpListener.java
@@ -1,8 +1,6 @@
 package com.fangxuele.tool.push.ui.listener;
 
-import cn.hutool.log.Log;
-import cn.hutool.log.LogFactory;
-import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.HelpForm;
 
 import java.awt.*;
 import java.awt.event.MouseAdapter;
@@ -20,10 +18,9 @@
  * @since 2018/2/9.
  */
 public class HelpListener {
-    private static final Log logger = LogFactory.get();
 
     public static void addListeners() {
-        MainWindow.mainWindow.getLabelOnlineHelp().addMouseListener(new MouseAdapter() {
+        HelpForm.helpForm.getLabelOnlineHelp().addMouseListener(new MouseAdapter() {
             @Override
             public void mouseClicked(MouseEvent e) {
                 super.mouseClicked(e);
@@ -38,7 +35,7 @@ public void mouseClicked(MouseEvent e) {
             @Override
             public void mouseEntered(MouseEvent e) {
                 super.mouseEntered(e);
-                MainWindow.mainWindow.getLabelOnlineHelp().setCursor(new Cursor(Cursor.HAND_CURSOR));
+                HelpForm.helpForm.getLabelOnlineHelp().setCursor(new Cursor(Cursor.HAND_CURSOR));
             }
 
         });
diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/MemberListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/MemberListener.java
index 4c419062..501f3c7d 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/listener/MemberListener.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/listener/MemberListener.java
@@ -1,38 +1,62 @@
 package com.fangxuele.tool.push.ui.listener;
 
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.file.FileReader;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
 import cn.hutool.poi.excel.ExcelReader;
 import cn.hutool.poi.excel.ExcelUtil;
-import com.fangxuele.tool.push.util.CharSetUtil;
-import com.fangxuele.tool.push.util.DbUtilMySQL;
+import cn.hutool.poi.excel.ExcelWriter;
+import com.fangxuele.tool.push.dao.TWxMpUserMapper;
+import com.fangxuele.tool.push.domain.TWxMpUser;
+import com.fangxuele.tool.push.logic.MessageTypeEnum;
 import com.fangxuele.tool.push.logic.PushData;
 import com.fangxuele.tool.push.logic.PushManage;
 import com.fangxuele.tool.push.ui.Init;
+import com.fangxuele.tool.push.ui.component.TableInCellImageLabelRenderer;
 import com.fangxuele.tool.push.ui.form.MainWindow;
-import com.fangxuele.tool.push.util.SystemUtil;
+import com.fangxuele.tool.push.ui.form.MemberForm;
+import com.fangxuele.tool.push.util.CharSetUtil;
+import com.fangxuele.tool.push.util.DbUtilMySQL;
+import com.fangxuele.tool.push.util.JTableUtil;
+import com.fangxuele.tool.push.util.MybatisUtil;
 import com.opencsv.CSVReader;
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.result.WxMpUser;
 import me.chanjar.weixin.mp.bean.result.WxMpUserList;
 import me.chanjar.weixin.mp.bean.tag.WxTagListUser;
 import me.chanjar.weixin.mp.bean.tag.WxUserTag;
+import org.apache.commons.compress.utils.Lists;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
 
 import javax.swing.*;
 import javax.swing.filechooser.FileFilter;
 import javax.swing.filechooser.FileNameExtensionFilter;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import java.awt.*;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
 import java.io.BufferedReader;
 import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
 import java.sql.ResultSet;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * 
@@ -50,35 +74,45 @@ public class MemberListener {
     /**
      * 用于导入多个标签的用户时去重判断
      */
-    private static Set tagUserSet;
+    public static Set tagUserSet;
+
+    public static final String TXT_FILE_DATA_SEPERATOR_REGEX = "\\|";
+
+    private static List toSearchRowsList;
+
+    private static TWxMpUserMapper tWxMpUserMapper = MybatisUtil.getSqlSession().getMapper(TWxMpUserMapper.class);
 
     public static void addListeners() {
         // 从文件导入按钮事件
-        MainWindow.mainWindow.getImportFromFileButton().addActionListener(e -> ThreadUtil.execute(() -> {
-            File file = new File(MainWindow.mainWindow.getMemberFilePathField().getText());
+        MemberForm.memberForm.getImportFromFileButton().addActionListener(e -> ThreadUtil.execute(() -> {
+            File file = new File(MemberForm.memberForm.getMemberFilePathField().getText());
             CSVReader reader = null;
-            FileReader fileReader = null;
+            FileReader fileReader;
 
             int currentImported = 0;
 
             try {
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(true);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(true);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(true);
                 String fileNameLowerCase = file.getName().toLowerCase();
+
                 if (fileNameLowerCase.endsWith(".csv")) {
                     // 可以解决中文乱码问题
                     DataInputStream in = new DataInputStream(new FileInputStream(file));
                     reader = new CSVReader(new InputStreamReader(in, CharSetUtil.getCharSet(file)));
                     String[] nextLine;
                     PushData.allUser = Collections.synchronizedList(new ArrayList<>());
+
                     while ((nextLine = reader.readNext()) != null) {
                         PushData.allUser.add(nextLine);
                         currentImported++;
-                        MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(currentImported));
+                        MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(currentImported));
                     }
                 } else if (fileNameLowerCase.endsWith(".xlsx") || fileNameLowerCase.endsWith(".xls")) {
                     ExcelReader excelReader = ExcelUtil.getReader(file);
                     List> readAll = excelReader.read(1, Integer.MAX_VALUE);
                     PushData.allUser = Collections.synchronizedList(new ArrayList<>());
+
                     for (List objects : readAll) {
                         if (objects != null && objects.size() > 0) {
                             String[] nextLine = new String[objects.size()];
@@ -87,7 +121,7 @@ public static void addListeners() {
                             }
                             PushData.allUser.add(nextLine);
                             currentImported++;
-                            MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(currentImported));
+                            MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(currentImported));
                         }
                     }
                 } else if (fileNameLowerCase.endsWith(".txt")) {
@@ -96,32 +130,31 @@ public static void addListeners() {
                     BufferedReader br = fileReader.getReader();
                     String line;
                     while ((line = br.readLine()) != null) {
-                        PushData.allUser.add(line.split(","));
+                        PushData.allUser.add(line.split(TXT_FILE_DATA_SEPERATOR_REGEX));
                         currentImported++;
-                        MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(currentImported));
+                        MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(currentImported));
                     }
                 } else {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "不支持该格式的文件!", "文件格式不支持",
+                    JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "不支持该格式的文件!", "文件格式不支持",
                             JOptionPane.ERROR_MESSAGE);
                     return;
                 }
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setMaximum(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入完成!", "完成",
+                renderMemberListTable();
+                JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入完成!", "完成",
                         JOptionPane.INFORMATION_MESSAGE);
 
-                Init.configer.setMemberFilePath(MainWindow.mainWindow.getMemberFilePathField().getText());
-                Init.configer.save();
+                Init.config.setMemberFilePath(MemberForm.memberForm.getMemberFilePathField().getText());
+                Init.config.save();
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
                 e1.printStackTrace();
             } finally {
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setMaximum(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setMaximum(100);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setValue(100);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(false);
                 if (reader != null) {
                     try {
                         reader.close();
@@ -134,23 +167,25 @@ public static void addListeners() {
         }));
 
         // 导入全员按钮事件
-        MainWindow.mainWindow.getMemberImportAllButton().addActionListener(e -> ThreadUtil.execute(() -> {
+        MemberForm.memberForm.getMemberImportAllButton().addActionListener(e -> ThreadUtil.execute(() -> {
             try {
                 getMpUserList();
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入完成!", "完成",
+                renderMemberListTable();
+                JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入完成!", "完成",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (WxErrorException e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
                 e1.printStackTrace();
             } finally {
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(false);
             }
         }));
 
         // 刷新可选的标签按钮事件
-        MainWindow.mainWindow.getMemberImportTagFreshButton().addActionListener(e -> {
+        MemberForm.memberForm.getMemberImportTagFreshButton().addActionListener(e -> {
             WxMpService wxMpService = PushManage.getWxMpService();
             if (wxMpService.getWxMpConfigStorage() == null) {
                 return;
@@ -159,17 +194,17 @@ public static void addListeners() {
             try {
                 List wxUserTagList = wxMpService.getUserTagService().tagGet();
 
-                MainWindow.mainWindow.getMemberImportTagComboBox().removeAllItems();
+                MemberForm.memberForm.getMemberImportTagComboBox().removeAllItems();
                 userTagMap = new HashMap<>();
 
                 for (WxUserTag wxUserTag : wxUserTagList) {
                     String item = wxUserTag.getName() + "/" + wxUserTag.getCount() + "用户";
-                    MainWindow.mainWindow.getMemberImportTagComboBox().addItem(item);
+                    MemberForm.memberForm.getMemberImportTagComboBox().addItem(item);
                     userTagMap.put(item, wxUserTag.getId());
                 }
 
             } catch (WxErrorException e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "刷新失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "刷新失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
                 e1.printStackTrace();
@@ -177,159 +212,116 @@ public static void addListeners() {
         });
 
         // 导入选择的标签分组用户按钮事件(取并集)
-        MainWindow.mainWindow.getMemberImportTagButton().addActionListener(e -> ThreadUtil.execute(() -> {
+        MemberForm.memberForm.getMemberImportTagButton().addActionListener(e -> ThreadUtil.execute(() -> {
             try {
-                if (MainWindow.mainWindow.getMemberImportTagComboBox().getSelectedItem() != null
-                        && StringUtils.isNotEmpty(MainWindow.mainWindow.getMemberImportTagComboBox().getSelectedItem().toString())) {
+                if (MemberForm.memberForm.getMemberImportTagComboBox().getSelectedItem() != null
+                        && StringUtils.isNotEmpty(MemberForm.memberForm.getMemberImportTagComboBox().getSelectedItem().toString())) {
 
-                    long selectedTagId = userTagMap.get(MainWindow.mainWindow.getMemberImportTagComboBox().getSelectedItem());
+                    long selectedTagId = userTagMap.get(MemberForm.memberForm.getMemberImportTagComboBox().getSelectedItem());
                     getMpUserListByTag(selectedTagId, false);
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入完成!", "完成",
+                    renderMemberListTable();
+                    JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入完成!", "完成",
                             JOptionPane.INFORMATION_MESSAGE);
                 } else {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "请先选择需要导入的标签!", "提示",
+                    JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "请先选择需要导入的标签!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                 }
             } catch (WxErrorException e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
                 e1.printStackTrace();
             } finally {
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(MainWindow.mainWindow.getMemberTabImportProgressBar().getMaximum());
+                MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setValue(MemberForm.memberForm.getMemberTabImportProgressBar().getMaximum());
+                MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(false);
             }
         }));
 
         // 导入选择的标签分组用户按钮事件(取交集)
-        MainWindow.mainWindow.getMemberImportTagRetainButton().addActionListener(e -> ThreadUtil.execute(() -> {
+        MemberForm.memberForm.getMemberImportTagRetainButton().addActionListener(e -> ThreadUtil.execute(() -> {
             try {
-                if (MainWindow.mainWindow.getMemberImportTagComboBox().getSelectedItem() != null
-                        && StringUtils.isNotEmpty(MainWindow.mainWindow.getMemberImportTagComboBox().getSelectedItem().toString())) {
+                if (MemberForm.memberForm.getMemberImportTagComboBox().getSelectedItem() != null
+                        && StringUtils.isNotEmpty(MemberForm.memberForm.getMemberImportTagComboBox().getSelectedItem().toString())) {
 
-                    long selectedTagId = userTagMap.get(MainWindow.mainWindow.getMemberImportTagComboBox().getSelectedItem());
+                    long selectedTagId = userTagMap.get(MemberForm.memberForm.getMemberImportTagComboBox().getSelectedItem());
                     getMpUserListByTag(selectedTagId, true);
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入完成!", "完成",
+                    renderMemberListTable();
+                    JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入完成!", "完成",
                             JOptionPane.INFORMATION_MESSAGE);
                 } else {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "请先选择需要导入的标签!", "提示",
+                    JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "请先选择需要导入的标签!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                 }
             } catch (WxErrorException e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
                 e1.printStackTrace();
             } finally {
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(MainWindow.mainWindow.getMemberTabImportProgressBar().getMaximum());
+                MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setValue(MemberForm.memberForm.getMemberTabImportProgressBar().getMaximum());
+                MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(false);
             }
         }));
 
         // 清除按钮事件
-        MainWindow.mainWindow.getClearImportButton().addActionListener(e -> {
-            int isClear = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getMemberPanel(), "确认清除?", "确认",
+        MemberForm.memberForm.getClearImportButton().addActionListener(e -> {
+            int isClear = JOptionPane.showConfirmDialog(MemberForm.memberForm.getMemberPanel(), "确认清除?", "确认",
                     JOptionPane.YES_NO_OPTION);
             if (isClear == JOptionPane.YES_OPTION) {
-                if (PushData.allUser != null) {
-                    PushData.allUser.clear();
-                    MainWindow.mainWindow.getMemberTabCountLabel().setText("0");
-                }
-                tagUserSet = null;
+                MemberForm.clearMember();
             }
         });
 
-        // 从历史导入按钮事件
-        MainWindow.mainWindow.getImportFromHisButton().addActionListener(e -> ThreadUtil.execute(() -> {
-            File file = new File(SystemUtil.configHome + "data/push_his" + File.separator
-                    + Objects.requireNonNull(MainWindow.mainWindow.getMemberHisComboBox().getSelectedItem()).toString());
-            CSVReader reader = null;
-            FileReader fileReader = null;
-
-            int currentImported = 0;
-
-            try {
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(true);
-                // 可以解决中文乱码问题
-                DataInputStream in = new DataInputStream(new FileInputStream(file));
-                reader = new CSVReader(new InputStreamReader(in, StandardCharsets.UTF_8));
-                String[] nextLine;
-                PushData.allUser = Collections.synchronizedList(new ArrayList<>());
-                while ((nextLine = reader.readNext()) != null) {
-                    PushData.allUser.add(nextLine);
-                    currentImported++;
-                    MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(currentImported));
-                }
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setMaximum(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入完成!", "完成",
-                        JOptionPane.INFORMATION_MESSAGE);
-            } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
-                        JOptionPane.ERROR_MESSAGE);
-                logger.error(e1);
-                e1.printStackTrace();
-            } finally {
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setMaximum(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(100);
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
-                if (reader != null) {
-                    try {
-                        reader.close();
-                    } catch (IOException e1) {
-                        logger.error(e1);
-                        e1.printStackTrace();
-                    }
-                }
-            }
-        }));
-
         // 从sql导入 按钮事件
-        MainWindow.mainWindow.getImportFromSqlButton().addActionListener(e -> ThreadUtil.execute(() -> {
-            MainWindow.mainWindow.getImportFromSqlButton().setEnabled(false);
-            MainWindow.mainWindow.getImportFromSqlButton().updateUI();
-
-            DbUtilMySQL dbUtilMySQL = DbUtilMySQL.getInstance();// 获取SQLServer连接实例
+        MemberForm.memberForm.getImportFromSqlButton().addActionListener(e -> ThreadUtil.execute(() -> {
+            MemberForm.memberForm.getImportFromSqlButton().setEnabled(false);
+            MemberForm.memberForm.getImportFromSqlButton().updateUI();
+            // 获取SQLServer连接实例
+            DbUtilMySQL dbUtilMySQL = DbUtilMySQL.getInstance();
 
-            String querySql = MainWindow.mainWindow.getImportFromSqlTextArea().getText();
+            String querySql = MemberForm.memberForm.getImportFromSqlTextArea().getText();
 
-            MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(true);
+            MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(true);
+            MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(true);
             if (StringUtils.isNotEmpty(querySql)) {
                 try {
-                    ResultSet rs = dbUtilMySQL.executeQuery(querySql);// 表查询
+                    // 表查询
+                    ResultSet rs = dbUtilMySQL.executeQuery(querySql);
                     PushData.allUser = Collections.synchronizedList(new ArrayList<>());
                     int currentImported = 0;
 
                     while (rs.next()) {
                         PushData.allUser.add(new String[]{rs.getString(1).trim()});
                         currentImported++;
-                        MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(currentImported));
+                        MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(currentImported));
                     }
-
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入完成!", "完成",
+                    renderMemberListTable();
+                    JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入完成!", "完成",
                             JOptionPane.INFORMATION_MESSAGE);
 
-                    Init.configer.setMemberSql(querySql);
-                    Init.configer.save();
+                    Init.config.setMemberSql(querySql);
+                    Init.config.save();
                 } catch (Exception e1) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
+                    JOptionPane.showMessageDialog(MemberForm.memberForm.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
                             JOptionPane.ERROR_MESSAGE);
                     logger.error(e1);
                     e1.printStackTrace();
                 } finally {
-                    MainWindow.mainWindow.getImportFromSqlButton().setEnabled(true);
-                    MainWindow.mainWindow.getImportFromSqlButton().updateUI();
-                    MainWindow.mainWindow.getMemberTabImportProgressBar().setMaximum(100);
-                    MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(100);
-                    MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
+                    MemberForm.memberForm.getImportFromSqlButton().setEnabled(true);
+                    MemberForm.memberForm.getImportFromSqlButton().updateUI();
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setMaximum(100);
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setValue(100);
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(false);
                 }
             }
         }));
 
         // 浏览按钮
-        MainWindow.mainWindow.getMemberImportExploreButton().addActionListener(e -> {
-            File beforeFile = new File(MainWindow.mainWindow.getMemberFilePathField().getText());
+        MemberForm.memberForm.getMemberImportExploreButton().addActionListener(e -> {
+            File beforeFile = new File(MemberForm.memberForm.getMemberFilePathField().getText());
             JFileChooser fileChooser;
 
             if (beforeFile.exists()) {
@@ -343,9 +335,192 @@ public static void addListeners() {
 
             int approve = fileChooser.showOpenDialog(MainWindow.mainWindow.getSettingPanel());
             if (approve == JFileChooser.APPROVE_OPTION) {
-                MainWindow.mainWindow.getMemberFilePathField().setText(fileChooser.getSelectedFile().getAbsolutePath());
+                MemberForm.memberForm.getMemberFilePathField().setText(fileChooser.getSelectedFile().getAbsolutePath());
+            }
+
+        });
+
+        // 全选按钮事件
+        MemberForm.memberForm.getSelectAllButton().addActionListener(e -> ThreadUtil.execute(() -> MemberForm.memberForm.getMemberListTable().selectAll()));
+
+        // 删除按钮事件
+        MemberForm.memberForm.getDeleteButton().addActionListener(e -> ThreadUtil.execute(() -> {
+            try {
+                int[] selectedRows = MemberForm.memberForm.getMemberListTable().getSelectedRows();
+                if (selectedRows.length == 0) {
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "请至少选择一个!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                } else {
+                    int isDelete = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getMemberPanel(), "确认删除?", "确认",
+                            JOptionPane.YES_NO_OPTION);
+                    if (isDelete == JOptionPane.YES_OPTION) {
+                        DefaultTableModel tableModel = (DefaultTableModel) MemberForm.memberForm.getMemberListTable().getModel();
+                        for (int i = selectedRows.length; i > 0; i--) {
+                            tableModel.removeRow(MemberForm.memberForm.getMemberListTable().getSelectedRow());
+                        }
+                        MemberForm.memberForm.getMemberListTable().updateUI();
+                    }
+                }
+            } catch (Exception e1) {
+                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "删除失败!\n\n" + e1.getMessage(), "失败",
+                        JOptionPane.ERROR_MESSAGE);
+                logger.error(e1);
+            }
+        }));
+
+        // 导入按钮事件
+        MemberForm.memberForm.getImportSelectedButton().addActionListener(e -> ThreadUtil.execute(() -> {
+            try {
+                int[] selectedRows = MemberForm.memberForm.getMemberListTable().getSelectedRows();
+                if (selectedRows.length <= 0) {
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "请至少选择一个!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                } else {
+                    PushData.allUser = Collections.synchronizedList(new ArrayList<>());
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(true);
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(true);
+                    for (int selectedRow : selectedRows) {
+                        String toImportData = (String) MemberForm.memberForm.getMemberListTable().getValueAt(selectedRow, 0);
+                        PushData.allUser.add(toImportData.split(TXT_FILE_DATA_SEPERATOR_REGEX));
+                        MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(PushData.allUser.size()));
+                        MemberForm.memberForm.getMemberTabImportProgressBar().setMaximum(100);
+                        MemberForm.memberForm.getMemberTabImportProgressBar().setValue(100);
+                        MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                    }
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "导入完成!", "完成",
+                            JOptionPane.INFORMATION_MESSAGE);
+                }
+            } catch (Exception e1) {
+                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
+                        JOptionPane.ERROR_MESSAGE);
+                logger.error(e1);
+            } finally {
+                MemberForm.memberForm.getMemberTabImportProgressBar().setMaximum(100);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setValue(100);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(false);
+            }
+        }));
+
+        // 导出按钮事件
+        MemberForm.memberForm.getExportButton().addActionListener(e -> ThreadUtil.execute(() -> {
+            int[] selectedRows = MemberForm.memberForm.getMemberListTable().getSelectedRows();
+            int columnCount = MemberForm.memberForm.getMemberListTable().getColumnCount();
+            ExcelWriter writer = null;
+            try {
+                if (selectedRows.length > 0) {
+                    JFileChooser fileChooser = new JFileChooser();
+                    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+                    int approve = fileChooser.showOpenDialog(MainWindow.mainWindow.getMemberPanel());
+                    String exportPath;
+                    if (approve == JFileChooser.APPROVE_OPTION) {
+                        exportPath = fileChooser.getSelectedFile().getAbsolutePath();
+                    } else {
+                        return;
+                    }
+
+                    List rowData;
+                    List> rows = Lists.newArrayList();
+                    for (int selectedRow : selectedRows) {
+                        rowData = Lists.newArrayList();
+                        for (int i = 0; i < columnCount; i++) {
+                            String data = (String) MemberForm.memberForm.getMemberListTable().getValueAt(selectedRow, i);
+                            rowData.add(data);
+                        }
+                        rows.add(rowData);
+                    }
+
+                    String nowTime = DateUtil.now().replace(":", "_").replace(" ", "_");
+                    String fileName = "MemberExport_" + MessageTypeEnum.getName(Init.config.getMsgType()) + "_" + nowTime + ".xlsx";
+                    //通过工具类创建writer
+                    writer = ExcelUtil.getWriter(exportPath + File.separator + fileName);
+
+                    //合并单元格后的标题行,使用默认标题样式
+                    writer.merge(rows.get(0).size() - 1, "目标用户列表导出");
+                    //一次性写出内容,强制输出标题
+                    writer.write(rows);
+
+                    writer.flush();
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导出成功!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                    try {
+                        Desktop desktop = Desktop.getDesktop();
+                        desktop.open(FileUtil.file(exportPath + File.separator + fileName));
+                    } catch (Exception e2) {
+                        logger.error(e2);
+                    }
+                } else {
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "请至少选择一个!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                }
+            } catch (Exception e1) {
+                JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "导出失败!\n\n" + e1.getMessage(), "失败",
+                        JOptionPane.ERROR_MESSAGE);
+                logger.error(e1);
+            } finally {
+                //关闭writer,释放内存
+                if (writer != null) {
+                    writer.close();
+                }
             }
+        }));
+
+        // 搜索按钮事件
+        MemberForm.memberForm.getSearchButton().addActionListener(e -> searchEvent());
+
+        // 线程池数键入回车
+        MemberForm.memberForm.getSearchTextField().addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyPressed(KeyEvent e) {
+                try {
+                    searchEvent();
+                } catch (Exception e1) {
+                    logger.error(e1);
+                } finally {
+                    super.keyPressed(e);
+                }
+            }
+        });
+
+        // 清空本地缓存按钮事件
+        MemberForm.memberForm.getClearDbCacheButton().addActionListener(e -> {
+            int count = tWxMpUserMapper.deleteAll();
+            JOptionPane.showMessageDialog(MainWindow.mainWindow.getMemberPanel(), "清理完毕!\n\n共清理:" + count + "条本地数据", "提示",
+                    JOptionPane.INFORMATION_MESSAGE);
+        });
+    }
+
+    private static void searchEvent() {
+        ThreadUtil.execute(() -> {
+            int rowCount = MemberForm.memberForm.getMemberListTable().getRowCount();
+            int columnCount = MemberForm.memberForm.getMemberListTable().getColumnCount();
+            try {
+                if (rowCount > 0 || toSearchRowsList != null) {
+                    if (toSearchRowsList == null) {
+                        toSearchRowsList = Lists.newArrayList();
+                        List rowData;
+                        for (int i = 0; i < rowCount; i++) {
+                            rowData = Lists.newArrayList();
+                            for (int j = 0; j < columnCount; j++) {
+                                String data = (String) MemberForm.memberForm.getMemberListTable().getValueAt(i, j);
+                                rowData.add(data);
+                            }
+                            toSearchRowsList.add(String.join("==", rowData));
+                        }
+                    }
+
+                    String keyWord = MemberForm.memberForm.getSearchTextField().getText();
+                    List searchResultList = toSearchRowsList.parallelStream().filter(rowStr -> rowStr.contains(keyWord)).collect(Collectors.toList());
 
+                    DefaultTableModel tableModel = (DefaultTableModel) MemberForm.memberForm.getMemberListTable().getModel();
+                    tableModel.setRowCount(0);
+                    for (String rowString : searchResultList) {
+                        tableModel.addRow(rowString.split("=="));
+                    }
+                }
+            } catch (Exception e1) {
+                logger.error(e1);
+            }
         });
     }
 
@@ -353,7 +528,8 @@ public static void addListeners() {
      * 拉取公众平台用户列表
      */
     public static void getMpUserList() throws WxErrorException {
-        MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(true);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(true);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(true);
 
         WxMpService wxMpService = PushManage.getWxMpService();
         if (wxMpService.getWxMpConfigStorage() == null) {
@@ -365,14 +541,14 @@ public static void getMpUserList() throws WxErrorException {
         PushManage.console("关注该公众账号的总用户数:" + wxMpUserList.getTotal());
         PushManage.console("拉取的OPENID个数:" + wxMpUserList.getCount());
 
-        MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
-        MainWindow.mainWindow.getMemberTabImportProgressBar().setMaximum((int) wxMpUserList.getTotal());
+        MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setMaximum((int) wxMpUserList.getTotal());
         int importedCount = 0;
         PushData.allUser = Collections.synchronizedList(new ArrayList<>());
 
         if (wxMpUserList.getCount() == 0) {
-            MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(importedCount));
-            MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(importedCount);
+            MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(importedCount));
+            MemberForm.memberForm.getMemberTabImportProgressBar().setValue(importedCount);
             return;
         }
 
@@ -381,8 +557,8 @@ public static void getMpUserList() throws WxErrorException {
         for (String openId : openIds) {
             PushData.allUser.add(new String[]{openId});
             importedCount++;
-            MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(importedCount));
-            MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(importedCount);
+            MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(importedCount));
+            MemberForm.memberForm.getMemberTabImportProgressBar().setValue(importedCount);
         }
 
         while (StringUtils.isNotEmpty(wxMpUserList.getNextOpenid())) {
@@ -397,12 +573,12 @@ public static void getMpUserList() throws WxErrorException {
             for (String openId : openIds) {
                 PushData.allUser.add(new String[]{openId});
                 importedCount++;
-                MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(importedCount));
-                MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(importedCount);
+                MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(importedCount));
+                MemberForm.memberForm.getMemberTabImportProgressBar().setValue(importedCount);
             }
         }
 
-        MainWindow.mainWindow.getMemberTabImportProgressBar().setValue((int) wxMpUserList.getTotal());
+        MemberForm.memberForm.getMemberTabImportProgressBar().setValue((int) wxMpUserList.getTotal());
     }
 
     /**
@@ -413,7 +589,8 @@ public static void getMpUserList() throws WxErrorException {
      * @throws WxErrorException
      */
     public static void getMpUserListByTag(Long tagId, boolean retain) throws WxErrorException {
-        MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(true);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(true);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(true);
 
         WxMpService wxMpService = PushManage.getWxMpService();
         if (wxMpService.getWxMpConfigStorage() == null) {
@@ -470,9 +647,132 @@ public static void getMpUserListByTag(Long tagId, boolean retain) throws WxError
             PushData.allUser.add(new String[]{openId});
         }
 
-        MainWindow.mainWindow.getMemberTabCountLabel().setText(String.valueOf(PushData.allUser.size()));
-        MainWindow.mainWindow.getMemberTabImportProgressBar().setIndeterminate(false);
-        MainWindow.mainWindow.getMemberTabImportProgressBar().setValue(MainWindow.mainWindow.getMemberTabImportProgressBar().getMaximum());
+        MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(PushData.allUser.size()));
+        MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setValue(MemberForm.memberForm.getMemberTabImportProgressBar().getMaximum());
+
+    }
+
+    /**
+     * 获取导入数据信息列表
+     */
+    private static void renderMemberListTable() {
+        toSearchRowsList = null;
+        DefaultTableModel tableModel = (DefaultTableModel) MemberForm.memberForm.getMemberListTable().getModel();
+        tableModel.setRowCount(0);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(true);
+        MemberForm.memberForm.getMemberTabImportProgressBar().setMaximum(PushData.allUser.size());
+
+        int msgType = Init.config.getMsgType();
+
+        // 是否是微信平台类消息
+        boolean isWeixinTypeMsg = false;
+        if (msgType == MessageTypeEnum.MP_TEMPLATE_CODE || msgType == MessageTypeEnum.MA_TEMPLATE_CODE
+                || msgType == MessageTypeEnum.KEFU_CODE || msgType == MessageTypeEnum.KEFU_PRIORITY_CODE) {
+            isWeixinTypeMsg = true;
+        }
+        // 导入列表
+        List headerNameList = Lists.newArrayList();
+        headerNameList.add("Data");
+        if (isWeixinTypeMsg) {
+            if (MemberForm.memberForm.getImportOptionAvatarCheckBox().isSelected()) {
+                headerNameList.add("头像");
+            }
+            if (MemberForm.memberForm.getImportOptionBasicInfoCheckBox().isSelected()) {
+                headerNameList.add("昵称");
+                headerNameList.add("性别");
+                headerNameList.add("地区");
+                headerNameList.add("关注时间");
+            }
+            headerNameList.add("openId");
+        } else {
+            headerNameList.add("数据");
+        }
+
+        String[] headerNames = new String[headerNameList.size()];
+        headerNameList.toArray(headerNames);
+        DefaultTableModel model = new DefaultTableModel(null, headerNames);
+        MemberForm.memberForm.getMemberListTable().setModel(model);
+        if (isWeixinTypeMsg && MemberForm.memberForm.getImportOptionAvatarCheckBox().isSelected()) {
+            MemberForm.memberForm.getMemberListTable().getColumn("头像").setCellRenderer(new TableInCellImageLabelRenderer());
+        }
+
+        DefaultTableCellRenderer hr = (DefaultTableCellRenderer) MemberForm.memberForm.getMemberListTable().getTableHeader()
+                .getDefaultRenderer();
+        // 表头列名居左
+        hr.setHorizontalAlignment(DefaultTableCellRenderer.LEFT);
+
+        // 隐藏第0列Data数据列
+        JTableUtil.hideColumn(MemberForm.memberForm.getMemberListTable(), 0);
 
+        // 设置行高
+        if (isWeixinTypeMsg && MemberForm.memberForm.getImportOptionAvatarCheckBox().isSelected()) {
+            MemberForm.memberForm.getMemberListTable().setRowHeight(66);
+        } else {
+            MemberForm.memberForm.getMemberListTable().setRowHeight(46);
+        }
+
+        List rowDataList;
+        for (int i = 0; i < PushData.allUser.size(); i++) {
+            String[] importedData = PushData.allUser.get(i);
+            try {
+                String openId = importedData[0];
+                rowDataList = new ArrayList<>();
+                rowDataList.add(String.join("|", importedData));
+                if (isWeixinTypeMsg) {
+                    if (MemberForm.memberForm.getImportOptionBasicInfoCheckBox().isSelected() ||
+                            MemberForm.memberForm.getImportOptionAvatarCheckBox().isSelected()) {
+
+                        WxMpUser wxMpUser;
+                        TWxMpUser tWxMpUser = tWxMpUserMapper.selectByPrimaryKey(openId);
+                        if (tWxMpUser != null) {
+                            wxMpUser = new WxMpUser();
+                            BeanUtil.copyProperties(tWxMpUser, wxMpUser);
+                        } else {
+                            WxMpService wxMpService = PushManage.getWxMpService();
+                            wxMpUser = wxMpService.getUserService().userInfo(openId);
+                            if (wxMpUser != null) {
+                                tWxMpUser = new TWxMpUser();
+                                BeanUtil.copyProperties(wxMpUser, tWxMpUser);
+                                tWxMpUserMapper.insertSelective(tWxMpUser);
+                            }
+                        }
+
+                        if (wxMpUser != null) {
+                            if (MemberForm.memberForm.getImportOptionAvatarCheckBox().isSelected()) {
+                                rowDataList.add(wxMpUser.getHeadImgUrl());
+                            }
+                            if (MemberForm.memberForm.getImportOptionBasicInfoCheckBox().isSelected()) {
+                                rowDataList.add(wxMpUser.getNickname());
+                                rowDataList.add(wxMpUser.getSexDesc());
+                                rowDataList.add(wxMpUser.getCountry() + "-" + wxMpUser.getProvince() + "-" + wxMpUser.getCity());
+                                rowDataList.add(DateFormatUtils.format(wxMpUser.getSubscribeTime() * 1000, "yyyy-MM-dd HH:mm:ss"));
+                            }
+                        } else {
+                            if (MemberForm.memberForm.getImportOptionAvatarCheckBox().isSelected()) {
+                                rowDataList.add("");
+                            }
+                            if (MemberForm.memberForm.getImportOptionBasicInfoCheckBox().isSelected()) {
+                                rowDataList.add("");
+                                rowDataList.add("");
+                                rowDataList.add("");
+                                rowDataList.add("");
+                            }
+                        }
+                        rowDataList.add(openId);
+                    } else {
+                        rowDataList.add(String.join("|", importedData));
+                    }
+                } else {
+                    rowDataList.add(String.join("|", importedData));
+                }
+
+                model.addRow(rowDataList.toArray());
+            } catch (WxErrorException e) {
+                logger.error(e);
+            }
+            MemberForm.memberForm.getMemberTabImportProgressBar().setValue(i + 1);
+        }
+        MemberForm.memberForm.getMemberListTable().updateUI();
     }
 }
diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/MessageTypeListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/MessageTypeListener.java
new file mode 100644
index 00000000..a91c7547
--- /dev/null
+++ b/src/main/java/com/fangxuele/tool/push/ui/listener/MessageTypeListener.java
@@ -0,0 +1,87 @@
+package com.fangxuele.tool.push.ui.listener;
+
+import com.fangxuele.tool.push.logic.MessageTypeEnum;
+import com.fangxuele.tool.push.ui.Init;
+import com.fangxuele.tool.push.ui.form.MessageTypeForm;
+
+import static com.fangxuele.tool.push.ui.form.MessageTypeForm.messageTypeForm;
+
+/**
+ * 
+ * 消息类型form事件监听
+ * 
+ * + * @author RememBerBer + * @since 2019/5/10. + */ +public class MessageTypeListener { + + public static void addListeners() { + messageTypeForm.getMpTemplateRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.MP_TEMPLATE_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getMaTemplateRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.MA_TEMPLATE_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getKefuRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.KEFU_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getKefuPriorityRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.KEFU_PRIORITY_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getAliYunRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.ALI_YUN_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getAliTemplateRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.ALI_TEMPLATE_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getTxYunRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.TX_YUN_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getYunPianRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.YUN_PIAN_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getUpYunRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.UP_YUN_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getHwYunRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.HW_YUN_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + messageTypeForm.getEMailRadioButton().addActionListener(e -> { + MessageTypeForm.clearAllSelected(); + Init.config.setMsgType(MessageTypeEnum.EMAIL_CODE); + Init.config.save(); + MessageTypeForm.init(); + }); + } +} diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/MsgListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/MsgListener.java index 9408c1f1..c2db05eb 100644 --- a/src/main/java/com/fangxuele/tool/push/ui/listener/MsgListener.java +++ b/src/main/java/com/fangxuele/tool/push/ui/listener/MsgListener.java @@ -3,10 +3,28 @@ import cn.hutool.core.thread.ThreadUtil; import cn.hutool.log.Log; import cn.hutool.log.LogFactory; -import com.fangxuele.tool.push.ui.Init; -import com.fangxuele.tool.push.logic.MsgHisManage; +import com.fangxuele.tool.push.dao.TMsgKefuMapper; +import com.fangxuele.tool.push.dao.TMsgKefuPriorityMapper; +import com.fangxuele.tool.push.dao.TMsgMaTemplateMapper; +import com.fangxuele.tool.push.dao.TMsgMpTemplateMapper; +import com.fangxuele.tool.push.dao.TMsgSmsMapper; +import com.fangxuele.tool.push.dao.TTemplateDataMapper; +import com.fangxuele.tool.push.domain.TMsgKefu; +import com.fangxuele.tool.push.domain.TMsgKefuPriority; +import com.fangxuele.tool.push.domain.TMsgMaTemplate; +import com.fangxuele.tool.push.domain.TMsgMpTemplate; +import com.fangxuele.tool.push.domain.TMsgSms; +import com.fangxuele.tool.push.domain.TTemplateData; +import com.fangxuele.tool.push.logic.MessageTypeEnum; import com.fangxuele.tool.push.logic.PushManage; +import com.fangxuele.tool.push.ui.Init; import com.fangxuele.tool.push.ui.form.MainWindow; +import com.fangxuele.tool.push.ui.form.MessageEditForm; +import com.fangxuele.tool.push.ui.form.MessageManageForm; +import com.fangxuele.tool.push.ui.form.PushHisForm; +import com.fangxuele.tool.push.ui.form.SettingForm; +import com.fangxuele.tool.push.util.MybatisUtil; +import com.fangxuele.tool.push.util.SqliteUtil; import org.apache.commons.lang3.StringUtils; import javax.swing.*; @@ -14,7 +32,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.HashSet; -import java.util.Map; +import java.util.List; import java.util.Objects; import java.util.Set; @@ -29,45 +47,90 @@ public class MsgListener { private static final Log logger = LogFactory.get(); - public static MsgHisManage msgHisManager = MsgHisManage.getInstance(); + private static TMsgKefuMapper msgKefuMapper = MybatisUtil.getSqlSession().getMapper(TMsgKefuMapper.class); + private static TMsgKefuPriorityMapper msgKefuPriorityMapper = MybatisUtil.getSqlSession().getMapper(TMsgKefuPriorityMapper.class); + private static TMsgMaTemplateMapper msgMaTemplateMapper = MybatisUtil.getSqlSession().getMapper(TMsgMaTemplateMapper.class); + private static TMsgMpTemplateMapper msgMpTemplateMapper = MybatisUtil.getSqlSession().getMapper(TMsgMpTemplateMapper.class); + private static TMsgSmsMapper msgSmsMapper = MybatisUtil.getSqlSession().getMapper(TMsgSmsMapper.class); + private static TTemplateDataMapper templateDataMapper = MybatisUtil.getSqlSession().getMapper(TTemplateDataMapper.class); public static void addListeners() { // 点击左侧表格事件 - MainWindow.mainWindow.getMsgHistable().addMouseListener(new MouseAdapter() { + MessageManageForm.messageManageForm.getMsgHistable().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ThreadUtil.execute(() -> { - MainWindow.mainWindow.getPushHisTextArea().setText(""); + PushHisForm.pushHisForm.getPushHisTextArea().setText(""); - int selectedRow = MainWindow.mainWindow.getMsgHistable().getSelectedRow(); - String selectedMsgName = MainWindow.mainWindow.getMsgHistable() - .getValueAt(selectedRow, 1).toString(); + int selectedRow = MessageManageForm.messageManageForm.getMsgHistable().getSelectedRow(); + String selectedMsgName = MessageManageForm.messageManageForm.getMsgHistable() + .getValueAt(selectedRow, 0).toString(); - Init.initMsgTab(selectedMsgName); + MessageEditForm.init(selectedMsgName); }); super.mouseClicked(e); } }); - // 消息类型切换事件 - MainWindow.mainWindow.getMsgTypeComboBox().addItemListener(e -> Init.switchMsgType(e.getItem().toString())); + // 历史消息管理-删除 + MessageManageForm.messageManageForm.getMsgHisTableDeleteButton().addActionListener(e -> ThreadUtil.execute(() -> { + try { + int[] selectedRows = MessageManageForm.messageManageForm.getMsgHistable().getSelectedRows(); + + if (selectedRows.length == 0) { + JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "请至少选择一个!", "提示", + JOptionPane.INFORMATION_MESSAGE); + } else { + int isDelete = JOptionPane.showConfirmDialog(SettingForm.settingForm.getSettingPanel(), "确认删除?", "确认", + JOptionPane.YES_NO_OPTION); + if (isDelete == JOptionPane.YES_OPTION) { + DefaultTableModel tableModel = (DefaultTableModel) MessageManageForm.messageManageForm.getMsgHistable() + .getModel(); + int msgType = Init.config.getMsgType(); + + for (int i = selectedRows.length; i > 0; i--) { + int selectedRow = MessageManageForm.messageManageForm.getMsgHistable().getSelectedRow(); + String msgName = (String) tableModel.getValueAt(selectedRow, 0); + if (msgType == MessageTypeEnum.KEFU_CODE) { + msgKefuMapper.deleteByMsgTypeAndName(msgType, msgName); + } else if (msgType == MessageTypeEnum.KEFU_PRIORITY_CODE) { + msgKefuPriorityMapper.deleteByMsgTypeAndName(msgType, msgName); + } else if (msgType == MessageTypeEnum.MA_TEMPLATE_CODE) { + msgMaTemplateMapper.deleteByMsgTypeAndName(msgType, msgName); + } else if (msgType == MessageTypeEnum.MP_TEMPLATE_CODE) { + msgMpTemplateMapper.deleteByMsgTypeAndName(msgType, msgName); + } else { + msgSmsMapper.deleteByMsgTypeAndName(msgType, msgName); + } + + tableModel.removeRow(selectedRow); + } + MessageEditForm.init(null); + } + } + } catch (Exception e1) { + JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "删除失败!\n\n" + e1.getMessage(), "失败", + JOptionPane.ERROR_MESSAGE); + logger.error(e1); + } + })); // 客服消息类型切换事件 - MainWindow.mainWindow.getMsgKefuMsgTypeComboBox().addItemListener(e -> Init.switchKefuMsgType(e.getItem().toString())); + MessageEditForm.messageEditForm.getMsgKefuMsgTypeComboBox().addItemListener(e -> MessageEditForm.switchKefuMsgType(e.getItem().toString())); // 模板数据-添加 按钮事件 - MainWindow.mainWindow.getTemplateMsgDataAddButton().addActionListener(e -> { + MessageEditForm.messageEditForm.getTemplateMsgDataAddButton().addActionListener(e -> { String[] data = new String[3]; - data[0] = MainWindow.mainWindow.getTemplateDataNameTextField().getText(); - data[1] = MainWindow.mainWindow.getTemplateDataValueTextField().getText(); - data[2] = MainWindow.mainWindow.getTemplateDataColorTextField().getText(); + data[0] = MessageEditForm.messageEditForm.getTemplateDataNameTextField().getText(); + data[1] = MessageEditForm.messageEditForm.getTemplateDataValueTextField().getText(); + data[2] = MessageEditForm.messageEditForm.getTemplateDataColorTextField().getText(); - if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) { - Init.initTemplateDataTable(); + if (MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel().getRowCount() == 0) { + MessageEditForm.initTemplateDataTable(); } - DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable() + DefaultTableModel tableModel = (DefaultTableModel) MessageEditForm.messageEditForm.getTemplateMsgDataTable() .getModel(); int rowCount = tableModel.getRowCount(); @@ -79,10 +142,10 @@ public void mouseClicked(MouseEvent e) { } if (StringUtils.isEmpty(data[0]) || StringUtils.isEmpty(data[1])) { - JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "key或value不能为空!", "提示", + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "Name或value不能为空!", "提示", JOptionPane.INFORMATION_MESSAGE); } else if (keySet.contains(data[0])) { - JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "key不能重复!", "提示", + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "Name不能重复!", "提示", JOptionPane.INFORMATION_MESSAGE); } else { if (StringUtils.isEmpty(data[2])) { @@ -95,53 +158,209 @@ public void mouseClicked(MouseEvent e) { }); // 保存按钮事件 - MainWindow.mainWindow.getMsgSaveButton().addActionListener(e -> { - String msgName = MainWindow.mainWindow.getMsgNameField().getText(); + MessageEditForm.messageEditForm.getMsgSaveButton().addActionListener(e -> { + String msgName = MessageEditForm.messageEditForm.getMsgNameField().getText(); if (StringUtils.isBlank(msgName)) { JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请填写推送任务名称!\n\n", "失败", JOptionPane.ERROR_MESSAGE); return; } - Map msgMap = msgHisManager.readMsgHis(); + + int msgType = Init.config.getMsgType(); + int msgId = 0; + + boolean existSameMsg = false; + if (msgType == MessageTypeEnum.KEFU_CODE) { + List tMsgKefuList = msgKefuMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgKefuList.size() > 0) { + existSameMsg = true; + msgId = tMsgKefuList.get(0).getId(); + } + } else if (msgType == MessageTypeEnum.KEFU_PRIORITY_CODE) { + List tMsgKefuPriorityList = msgKefuPriorityMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgKefuPriorityList.size() > 0) { + existSameMsg = true; + msgId = tMsgKefuPriorityList.get(0).getId(); + } + } else if (msgType == MessageTypeEnum.MA_TEMPLATE_CODE) { + List tMsgMaTemplateList = msgMaTemplateMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgMaTemplateList.size() > 0) { + existSameMsg = true; + msgId = tMsgMaTemplateList.get(0).getId(); + } + } else if (msgType == MessageTypeEnum.MP_TEMPLATE_CODE) { + List tMsgMpTemplateList = msgMpTemplateMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgMpTemplateList.size() > 0) { + existSameMsg = true; + msgId = tMsgMpTemplateList.get(0).getId(); + } + } else { + List tMsgSmsList = msgSmsMapper.selectByMsgTypeAndMsgName(msgType, msgName); + if (tMsgSmsList.size() > 0) { + existSameMsg = true; + msgId = tMsgSmsList.get(0).getId(); + } + } int isCover = JOptionPane.NO_OPTION; - if (msgMap.containsKey(msgName)) { + if (existSameMsg) { // 如果存在,是否覆盖 isCover = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getMessagePanel(), "已经存在同名的历史消息,\n是否覆盖?", "确认", JOptionPane.YES_NO_OPTION); } try { - if (!msgMap.containsKey(msgName) || isCover == JOptionPane.YES_OPTION) { - String[] record = new String[MsgHisManage.ARRAY_LENGTH]; - record[0] = msgName; - record[1] = Objects.requireNonNull(MainWindow.mainWindow.getMsgTypeComboBox().getSelectedItem()).toString(); - record[2] = MainWindow.mainWindow.getMsgTemplateIdTextField().getText(); - record[3] = MainWindow.mainWindow.getMsgTemplateUrlTextField().getText(); - record[4] = Objects.requireNonNull(MainWindow.mainWindow.getMsgKefuMsgTypeComboBox().getSelectedItem()).toString(); - record[5] = MainWindow.mainWindow.getMsgKefuMsgTitleTextField().getText(); - record[6] = MainWindow.mainWindow.getMsgKefuPicUrlTextField().getText(); - record[7] = MainWindow.mainWindow.getMsgKefuDescTextField().getText(); - record[8] = MainWindow.mainWindow.getMsgKefuUrlTextField().getText(); - record[9] = MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().getText(); - record[10] = MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().getText(); - record[11] = MainWindow.mainWindow.getMsgTemplateKeyWordTextField().getText(); - record[12] = MainWindow.mainWindow.getMsgYunpianMsgContentTextField().getText(); - - msgMap.put(msgName, record); - - msgHisManager.writeMsgHis(msgMap); - msgHisManager.writeTemplateData(msgName); - - Init.configer.setMsgName(msgName); - Init.configer.setPreviewUser(MainWindow.mainWindow.getPreviewUserField().getText()); - Init.configer.save(); + if (!existSameMsg || isCover == JOptionPane.YES_OPTION) { + String templateId = MessageEditForm.messageEditForm.getMsgTemplateIdTextField().getText(); + String templateUrl = MessageEditForm.messageEditForm.getMsgTemplateUrlTextField().getText(); + String kefuMsgType = Objects.requireNonNull(MessageEditForm.messageEditForm.getMsgKefuMsgTypeComboBox().getSelectedItem()).toString(); + String kefuMsgTitle = MessageEditForm.messageEditForm.getMsgKefuMsgTitleTextField().getText(); + String kefuPicUrl = MessageEditForm.messageEditForm.getMsgKefuPicUrlTextField().getText(); + String kefuDesc = MessageEditForm.messageEditForm.getMsgKefuDescTextField().getText(); + String kefuUrl = MessageEditForm.messageEditForm.getMsgKefuUrlTextField().getText(); + String templateMiniAppid = MessageEditForm.messageEditForm.getMsgTemplateMiniAppidTextField().getText(); + String templateMiniPagePath = MessageEditForm.messageEditForm.getMsgTemplateMiniPagePathTextField().getText(); + String templateKeyWord = MessageEditForm.messageEditForm.getMsgTemplateKeyWordTextField().getText(); + String yunpianMsgContent = MessageEditForm.messageEditForm.getMsgYunpianMsgContentTextField().getText(); + + String now = SqliteUtil.nowDateForSqlite(); + + if (msgType == MessageTypeEnum.KEFU_CODE) { + TMsgKefu tMsgKefu = new TMsgKefu(); + tMsgKefu.setMsgType(msgType); + tMsgKefu.setMsgName(msgName); + tMsgKefu.setKefuMsgType(kefuMsgType); + tMsgKefu.setContent(kefuMsgTitle); + tMsgKefu.setTitle(kefuMsgTitle); + tMsgKefu.setImgUrl(kefuPicUrl); + tMsgKefu.setDescribe(kefuDesc); + tMsgKefu.setUrl(kefuUrl); + tMsgKefu.setCreateTime(now); + tMsgKefu.setModifiedTime(now); + + if (existSameMsg) { + msgKefuMapper.updateByMsgTypeAndMsgName(tMsgKefu); + } else { + msgKefuMapper.insertSelective(tMsgKefu); + msgId = tMsgKefu.getId(); + } + } else if (msgType == MessageTypeEnum.KEFU_PRIORITY_CODE) { + TMsgKefuPriority tMsgKefuPriority = new TMsgKefuPriority(); + tMsgKefuPriority.setMsgType(msgType); + tMsgKefuPriority.setMsgName(msgName); + tMsgKefuPriority.setTemplateId(templateId); + tMsgKefuPriority.setUrl(templateUrl); + tMsgKefuPriority.setMaAppid(templateMiniAppid); + tMsgKefuPriority.setMaPagePath(templateMiniPagePath); + tMsgKefuPriority.setKefuMsgType(kefuMsgType); + tMsgKefuPriority.setContent(kefuMsgTitle); + tMsgKefuPriority.setTitle(kefuMsgTitle); + tMsgKefuPriority.setImgUrl(kefuPicUrl); + tMsgKefuPriority.setDescribe(kefuDesc); + tMsgKefuPriority.setKefuUrl(kefuUrl); + tMsgKefuPriority.setCreateTime(now); + tMsgKefuPriority.setModifiedTime(now); + + if (existSameMsg) { + msgKefuPriorityMapper.updateByMsgTypeAndMsgName(tMsgKefuPriority); + } else { + msgKefuPriorityMapper.insertSelective(tMsgKefuPriority); + msgId = tMsgKefuPriority.getId(); + } + } else if (msgType == MessageTypeEnum.MA_TEMPLATE_CODE) { + TMsgMaTemplate tMsgMaTemplate = new TMsgMaTemplate(); + tMsgMaTemplate.setMsgType(msgType); + tMsgMaTemplate.setMsgName(msgName); + tMsgMaTemplate.setTemplateId(templateId); + tMsgMaTemplate.setPage(templateUrl); + tMsgMaTemplate.setEmphasisKeyword(templateKeyWord); + tMsgMaTemplate.setCreateTime(now); + tMsgMaTemplate.setModifiedTime(now); + + if (existSameMsg) { + msgMaTemplateMapper.updateByMsgTypeAndMsgName(tMsgMaTemplate); + } else { + msgMaTemplateMapper.insertSelective(tMsgMaTemplate); + msgId = tMsgMaTemplate.getId(); + } + } else if (msgType == MessageTypeEnum.MP_TEMPLATE_CODE) { + TMsgMpTemplate tMsgMpTemplate = new TMsgMpTemplate(); + tMsgMpTemplate.setMsgType(msgType); + tMsgMpTemplate.setMsgName(msgName); + tMsgMpTemplate.setTemplateId(templateId); + tMsgMpTemplate.setUrl(templateUrl); + tMsgMpTemplate.setMaAppid(templateMiniAppid); + tMsgMpTemplate.setMaPagePath(templateMiniPagePath); + tMsgMpTemplate.setCreateTime(now); + tMsgMpTemplate.setModifiedTime(now); + + if (existSameMsg) { + msgMpTemplateMapper.updateByMsgTypeAndMsgName(tMsgMpTemplate); + } else { + msgMpTemplateMapper.insertSelective(tMsgMpTemplate); + msgId = tMsgMpTemplate.getId(); + } + } else { + TMsgSms tMsgSms = new TMsgSms(); + tMsgSms.setMsgType(msgType); + tMsgSms.setMsgName(msgName); + tMsgSms.setTemplateId(templateId); + tMsgSms.setContent(yunpianMsgContent); + tMsgSms.setCreateTime(now); + tMsgSms.setModifiedTime(now); + + if (existSameMsg) { + msgSmsMapper.updateByMsgTypeAndMsgName(tMsgSms); + } else { + msgSmsMapper.insertSelective(tMsgSms); + msgId = tMsgSms.getId(); + } + } + + // 保存模板数据 + if (msgType != MessageTypeEnum.KEFU_CODE && msgType != MessageTypeEnum.YUN_PIAN_CODE) { + + // 如果是覆盖保存,则先清空之前的模板数据 + if (existSameMsg) { + templateDataMapper.deleteByMsgTypeAndMsgId(msgType, msgId); + } + + // 如果table为空,则初始化 + if (MessageEditForm.messageEditForm.getTemplateMsgDataTable().getModel().getRowCount() == 0) { + MessageEditForm.initTemplateDataTable(); + } + + // 逐行读取 + DefaultTableModel tableModel = (DefaultTableModel) MessageEditForm.messageEditForm.getTemplateMsgDataTable() + .getModel(); + int rowCount = tableModel.getRowCount(); + for (int i = 0; i < rowCount; i++) { + String name = (String) tableModel.getValueAt(i, 0); + String value = (String) tableModel.getValueAt(i, 1); + String color = ((String) tableModel.getValueAt(i, 2)).trim(); + + TTemplateData tTemplateData = new TTemplateData(); + tTemplateData.setMsgType(msgType); + tTemplateData.setMsgId(msgId); + tTemplateData.setName(name); + tTemplateData.setValue(value); + tTemplateData.setColor(color); + tTemplateData.setCreateTime(now); + tTemplateData.setModifiedTime(now); + + templateDataMapper.insert(tTemplateData); + } + + } + + Init.config.setPreviewUser(MessageEditForm.messageEditForm.getPreviewUserField().getText()); + Init.config.save(); JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功", JOptionPane.INFORMATION_MESSAGE); - Init.initMsgTab(null); - Init.initSettingTab(); + MessageEditForm.init(null); + MessageManageForm.init(); } } catch (Exception e1) { JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败", @@ -152,10 +371,10 @@ public void mouseClicked(MouseEvent e) { }); // 预览按钮事件 - MainWindow.mainWindow.getPreviewMsgButton().addActionListener(e -> { + MessageEditForm.messageEditForm.getPreviewMsgButton().addActionListener(e -> { try { - if ("".equals(MainWindow.mainWindow.getPreviewUserField().getText().trim())) { - JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "预览消息用户不能为空!", "提示", + if ("".equals(MessageEditForm.messageEditForm.getPreviewUserField().getText().trim())) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "预览用户不能为空!", "提示", JOptionPane.INFORMATION_MESSAGE); } else { if (PushManage.preview()) { @@ -171,29 +390,10 @@ public void mouseClicked(MouseEvent e) { }); // 编辑消息-新建 - MainWindow.mainWindow.getCreateMsgButton().addActionListener(e -> { - MainWindow.mainWindow.getMsgNameField().setText(""); - MainWindow.mainWindow.getMsgTemplateIdTextField().setText(""); - MainWindow.mainWindow.getMsgTemplateUrlTextField().setText(""); - MainWindow.mainWindow.getMsgKefuMsgTitleTextField().setText(""); - MainWindow.mainWindow.getMsgKefuPicUrlTextField().setText(""); - MainWindow.mainWindow.getMsgKefuDescTextField().setText(""); - MainWindow.mainWindow.getMsgKefuUrlTextField().setText(""); - MainWindow.mainWindow.getMsgTemplateMiniAppidTextField().setText(""); - MainWindow.mainWindow.getMsgTemplateMiniPagePathTextField().setText(""); - MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setText(""); - MainWindow.mainWindow.getMsgYunpianMsgContentTextField().setText(""); - - if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) { - Init.initTemplateDataTable(); - } - - DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getTemplateMsgDataTable() - .getModel(); - int rowCount = tableModel.getRowCount(); - for (int i = 0; i < rowCount; i++) { - tableModel.removeRow(0); - } + MessageManageForm.messageManageForm.getCreateMsgButton().addActionListener(e -> { + MessageEditForm.clearAllField(); + MessageEditForm.initTemplateDataTable(); + MessageEditForm.messageEditForm.getMsgNameField().grabFocus(); }); } } diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/PushHisListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/PushHisListener.java index 32354711..dd301c5e 100644 --- a/src/main/java/com/fangxuele/tool/push/ui/listener/PushHisListener.java +++ b/src/main/java/com/fangxuele/tool/push/ui/listener/PushHisListener.java @@ -5,9 +5,14 @@ import cn.hutool.core.thread.ThreadUtil; import cn.hutool.log.Log; import cn.hutool.log.LogFactory; -import com.fangxuele.tool.push.ui.Init; +import com.fangxuele.tool.push.dao.TPushHistoryMapper; +import com.fangxuele.tool.push.domain.TPushHistory; +import com.fangxuele.tool.push.logic.PushData; import com.fangxuele.tool.push.ui.form.MainWindow; -import com.fangxuele.tool.push.util.SystemUtil; +import com.fangxuele.tool.push.ui.form.MemberForm; +import com.fangxuele.tool.push.ui.form.PushHisForm; +import com.fangxuele.tool.push.util.MybatisUtil; +import com.opencsv.CSVReader; import org.apache.commons.lang3.StringUtils; import javax.swing.*; @@ -16,11 +21,15 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.BufferedReader; +import java.io.DataInputStream; import java.io.File; +import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.List; +import java.util.Collections; /** *
@@ -33,34 +42,34 @@
 public class PushHisListener {
     private static final Log logger = LogFactory.get();
 
-    private static boolean selectAllToggle = false;
+    private static TPushHistoryMapper pushHistoryMapper = MybatisUtil.getSqlSession().getMapper(TPushHistoryMapper.class);
 
     public static void addListeners() {
         // 点击左侧表格事件
-        MainWindow.mainWindow.getPushHisLeftTable().addMouseListener(new MouseAdapter() {
+        PushHisForm.pushHisForm.getPushHisLeftTable().addMouseListener(new MouseAdapter() {
             @Override
             public void mouseClicked(MouseEvent e) {
                 ThreadUtil.execute(() -> {
-                    MainWindow.mainWindow.getPushHisTextArea().setText("");
+                    PushHisForm.pushHisForm.getPushHisTextArea().setText("");
 
-                    int selectedRow = MainWindow.mainWindow.getPushHisLeftTable().getSelectedRow();
-                    String selectedFileName = MainWindow.mainWindow.getPushHisLeftTable()
-                            .getValueAt(selectedRow, 1).toString();
-                    File pushHisFile = new File(SystemUtil.configHome + "data" + File.separator
-                            + "push_his" + File.separator + selectedFileName);
+                    int selectedRow = PushHisForm.pushHisForm.getPushHisLeftTable().getSelectedRow();
+                    String selectedId = PushHisForm.pushHisForm.getPushHisLeftTable()
+                            .getValueAt(selectedRow, 3).toString();
+                    TPushHistory tPushHistory = pushHistoryMapper.selectByPrimaryKey(Integer.valueOf(selectedId));
+                    File pushHisFile = new File(tPushHistory.getCsvFile());
 
                     try {
                         BufferedReader br = new BufferedReader(new FileReader(pushHisFile));
                         String line = br.readLine();
                         long count = 0;
                         while (StringUtils.isNotEmpty(line)) {
-                            MainWindow.mainWindow.getPushHisTextArea().append(line);
-                            MainWindow.mainWindow.getPushHisTextArea().append("\n");
+                            PushHisForm.pushHisForm.getPushHisTextArea().append(line);
+                            PushHisForm.pushHisForm.getPushHisTextArea().append("\n");
                             line = br.readLine();
                             count++;
                         }
 
-                        MainWindow.mainWindow.getPushHisCountLabel().setText("共" + count + "条");
+                        PushHisForm.pushHisForm.getPushHisCountLabel().setText("共" + count + "条");
                     } catch (IOException e1) {
                         e1.printStackTrace();
                     }
@@ -70,57 +79,33 @@ public void mouseClicked(MouseEvent e) {
             }
         });
 
-        // 推送历史管理-全选
-        MainWindow.mainWindow.getPushHisLeftSelectAllButton().addActionListener(e -> ThreadUtil.execute(() -> {
-            toggleSelectAll();
-            DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getPushHisLeftTable()
-                    .getModel();
-            int rowCount = tableModel.getRowCount();
-            for (int i = 0; i < rowCount; i++) {
-                tableModel.setValueAt(selectAllToggle, i, 0);
-            }
-        }));
-
         // 推送历史管理-删除
-        MainWindow.mainWindow.getPushHisLeftDeleteButton().addActionListener(e -> ThreadUtil.execute(() -> {
+        PushHisForm.pushHisForm.getPushHisLeftDeleteButton().addActionListener(e -> ThreadUtil.execute(() -> {
             try {
-                DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getPushHisLeftTable()
-                        .getModel();
-                int rowCount = tableModel.getRowCount();
-
-                int selectedCount = 0;
-                for (int i = 0; i < rowCount; i++) {
-                    boolean isSelected = (boolean) tableModel.getValueAt(i, 0);
-                    if (isSelected) {
-                        selectedCount++;
-                    }
-                }
-
-                if (selectedCount == 0) {
+                int[] selectedRows = PushHisForm.pushHisForm.getPushHisLeftTable().getSelectedRows();
+                if (selectedRows.length == 0) {
                     JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请至少选择一个!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                 } else {
                     int isDelete = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getSettingPanel(), "确认删除?", "确认",
                             JOptionPane.YES_NO_OPTION);
                     if (isDelete == JOptionPane.YES_OPTION) {
-                        for (int i = 0; i < rowCount; ) {
-                            boolean delete = (boolean) tableModel.getValueAt(i, 0);
-                            if (delete) {
-                                String fileName = (String) tableModel.getValueAt(i, 1);
-                                File msgTemplateDataFile = new File(SystemUtil.configHome + "data" + File.separator + "push_his" + File.separator + fileName);
-                                if (msgTemplateDataFile.exists()) {
-                                    msgTemplateDataFile.delete();
-                                }
-                                tableModel.removeRow(i);
-                                MainWindow.mainWindow.getPushHisLeftTable().updateUI();
-                                i = 0;
-                                rowCount = tableModel.getRowCount();
-                            } else {
-                                i++;
+                        DefaultTableModel tableModel = (DefaultTableModel) PushHisForm.pushHisForm.getPushHisLeftTable().getModel();
+                        for (int i = selectedRows.length; i > 0; i--) {
+                            int selectedRow = PushHisForm.pushHisForm.getPushHisLeftTable().getSelectedRow();
+                            Integer selectedId = (Integer) tableModel.getValueAt(selectedRow, 3);
+                            TPushHistory tPushHistory = pushHistoryMapper.selectByPrimaryKey(selectedId);
+
+                            File msgTemplateDataFile = new File(tPushHistory.getCsvFile());
+                            if (msgTemplateDataFile.exists()) {
+                                msgTemplateDataFile.delete();
                             }
-                        }
+                            pushHistoryMapper.deleteByPrimaryKey(selectedId);
 
-                        Init.initMemberTab();
+                            tableModel.removeRow(selectedRow);
+                        }
+                        PushHisForm.pushHisForm.getPushHisLeftTable().updateUI();
+                        PushHisForm.init();
                     }
                 }
             } catch (Exception e1) {
@@ -131,54 +116,43 @@ public void mouseClicked(MouseEvent e) {
         }));
 
         // 推送历史管理-复制按钮
-        MainWindow.mainWindow.getPushHisCopyButton().addActionListener(e -> ThreadUtil.execute(() -> {
+        PushHisForm.pushHisForm.getPushHisCopyButton().addActionListener(e -> ThreadUtil.execute(() -> {
             try {
-                MainWindow.mainWindow.getPushHisCopyButton().setEnabled(false);
+                PushHisForm.pushHisForm.getPushHisCopyButton().setEnabled(false);
                 JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "内容已经复制到剪贴板!", "复制成功",
                         JOptionPane.INFORMATION_MESSAGE);
-                ClipboardUtil.setStr(MainWindow.mainWindow.getPushHisTextArea().getText());
+                ClipboardUtil.setStr(PushHisForm.pushHisForm.getPushHisTextArea().getText());
             } catch (Exception e1) {
                 logger.error(e1);
             } finally {
-                MainWindow.mainWindow.getPushHisCopyButton().setEnabled(true);
+                PushHisForm.pushHisForm.getPushHisCopyButton().setEnabled(true);
             }
 
         }));
 
         // 推送历史管理-导出按钮
-        MainWindow.mainWindow.getPushHisExportButton().addActionListener(e -> {
-            List toExportFilePathList = new ArrayList<>();
-            int selectedCount = 0;
+        PushHisForm.pushHisForm.getPushHisExportButton().addActionListener(e -> {
+            int[] selectedRows = PushHisForm.pushHisForm.getPushHisLeftTable().getSelectedRows();
 
             try {
-                DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getPushHisLeftTable()
-                        .getModel();
-                int rowCount = tableModel.getRowCount();
-                for (int i = 0; i < rowCount; i++) {
-                    boolean selected = (boolean) tableModel.getValueAt(i, 0);
-                    if (selected) {
-                        selectedCount++;
-                        String fileName = (String) tableModel.getValueAt(i, 1);
-                        File msgTemplateDataFile = new File(SystemUtil.configHome + "data" + File.separator + "push_his" + File.separator + fileName);
-                        if (msgTemplateDataFile.exists()) {
-                            toExportFilePathList.add(msgTemplateDataFile.getAbsolutePath());
-                        }
-                    }
-                }
-
-                if (selectedCount > 0) {
+                if (selectedRows.length > 0) {
                     JFileChooser fileChooser = new JFileChooser();
                     fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                     int approve = fileChooser.showOpenDialog(MainWindow.mainWindow.getSettingPanel());
-                    String exportPath = "";
+                    String exportPath;
                     if (approve == JFileChooser.APPROVE_OPTION) {
                         exportPath = fileChooser.getSelectedFile().getAbsolutePath();
                     } else {
                         return;
                     }
 
-                    for (String toExportFilePath : toExportFilePathList) {
-                        FileUtil.copy(toExportFilePath, exportPath, true);
+                    for (int row : selectedRows) {
+                        Integer selectedId = (Integer) PushHisForm.pushHisForm.getPushHisLeftTable().getValueAt(row, 3);
+                        TPushHistory tPushHistory = pushHistoryMapper.selectByPrimaryKey(selectedId);
+                        File msgTemplateDataFile = new File(tPushHistory.getCsvFile());
+                        if (msgTemplateDataFile.exists()) {
+                            FileUtil.copy(msgTemplateDataFile.getAbsolutePath(), exportPath, true);
+                        }
                     }
                     JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "导出成功!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
@@ -201,18 +175,58 @@ public void mouseClicked(MouseEvent e) {
 
         });
 
-    }
+        // 重发
+        PushHisForm.pushHisForm.getResendFromHisButton().addActionListener(e -> ThreadUtil.execute(() -> {
+            int[] selectedRows = PushHisForm.pushHisForm.getPushHisLeftTable().getSelectedRows();
+            CSVReader reader = null;
+            try {
+                if (selectedRows.length > 0) {
+                    MainWindow.mainWindow.getTabbedPane().setSelectedIndex(3);
+                    PushData.allUser = Collections.synchronizedList(new ArrayList<>());
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(true);
+                    MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(true);
+                    for (int selectedRow : selectedRows) {
+                        Integer selectedId = (Integer) PushHisForm.pushHisForm.getPushHisLeftTable().getValueAt(selectedRow, 3);
+                        TPushHistory tPushHistory = pushHistoryMapper.selectByPrimaryKey(selectedId);
+                        File msgTemplateDataFile = new File(tPushHistory.getCsvFile());
+                        if (msgTemplateDataFile.exists()) {
+                            // 可以解决中文乱码问题
+                            DataInputStream in = new DataInputStream(new FileInputStream(msgTemplateDataFile));
+                            reader = new CSVReader(new InputStreamReader(in, StandardCharsets.UTF_8));
+                            String[] nextLine;
+                            while ((nextLine = reader.readNext()) != null) {
+                                PushData.allUser.add(nextLine);
+                                MemberForm.memberForm.getMemberTabCountLabel().setText(String.valueOf(PushData.allUser.size()));
+                            }
+                        }
+                    }
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "导入完成!", "完成",
+                            JOptionPane.INFORMATION_MESSAGE);
+                } else {
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请至少选择一个!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                }
+            } catch (Exception e1) {
+                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "导入失败!\n\n" + e1.getMessage(), "失败",
+                        JOptionPane.ERROR_MESSAGE);
+                logger.error(e1);
+            } finally {
+                MemberForm.memberForm.getMemberTabImportProgressBar().setMaximum(100);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setValue(100);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setIndeterminate(false);
+                MemberForm.memberForm.getMemberTabImportProgressBar().setVisible(false);
+                if (reader != null) {
+                    try {
+                        reader.close();
+                    } catch (IOException e1) {
+                        logger.error(e1);
+                        e1.printStackTrace();
+                    }
+                }
+            }
+
+        }));
 
-    /**
-     * 切换全选/全不选
-     *
-     * @return
-     */
-    private static void toggleSelectAll() {
-        if (!selectAllToggle) {
-            selectAllToggle = true;
-        } else {
-            selectAllToggle = false;
-        }
     }
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/PushListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/PushListener.java
index 8a7fd36d..9bf92060 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/listener/PushListener.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/listener/PushListener.java
@@ -2,6 +2,7 @@
 
 import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
@@ -9,6 +10,8 @@
 import com.fangxuele.tool.push.logic.RunPushThread;
 import com.fangxuele.tool.push.ui.Init;
 import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.MessageEditForm;
+import com.fangxuele.tool.push.ui.form.PushForm;
 import org.apache.commons.lang3.StringUtils;
 
 import javax.swing.*;
@@ -39,62 +42,62 @@ public class PushListener {
 
     public static void addListeners() {
         // 开始按钮事件
-        MainWindow.mainWindow.getPushStartButton().addActionListener((e) -> ThreadUtil.execute(() -> {
+        PushForm.pushForm.getPushStartButton().addActionListener((e) -> ThreadUtil.execute(() -> {
             if (checkBeforePush()) {
-                int isPush = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getPushPanel(),
+                int isPush = JOptionPane.showConfirmDialog(PushForm.pushForm.getPushPanel(),
                         "确定开始推送吗?\n\n推送消息:" +
-                                MainWindow.mainWindow.getMsgNameField().getText() +
+                                MessageEditForm.messageEditForm.getMsgNameField().getText() +
                                 "\n推送人数:" + PushData.allUser.size() +
                                 "\n\n空跑模式:" +
-                                MainWindow.mainWindow.getDryRunCheckBox().isSelected(), "确认推送?",
+                                PushForm.pushForm.getDryRunCheckBox().isSelected(), "确认推送?",
                         JOptionPane.YES_NO_OPTION);
                 if (isPush == JOptionPane.YES_OPTION) {
                     // 按钮状态
-                    MainWindow.mainWindow.getScheduleRunButton().setEnabled(false);
-                    MainWindow.mainWindow.getPushStartButton().setEnabled(false);
-                    MainWindow.mainWindow.getPushStopButton().setEnabled(true);
+                    PushForm.pushForm.getScheduleRunButton().setEnabled(false);
+                    PushForm.pushForm.getPushStartButton().setEnabled(false);
+                    PushForm.pushForm.getPushStopButton().setEnabled(true);
                     ThreadUtil.execute(new RunPushThread());
                 }
             }
         }));
 
         // 停止按钮事件
-        MainWindow.mainWindow.getPushStopButton().addActionListener((e) -> {
+        PushForm.pushForm.getPushStopButton().addActionListener((e) -> {
             if (!PushData.running && PushData.scheduling) {
-                MainWindow.mainWindow.getScheduleDetailLabel().setText("");
+                PushForm.pushForm.getScheduleDetailLabel().setText("");
                 if (serviceStartAt != null) {
                     serviceStartAt.shutdownNow();
                 }
-                MainWindow.mainWindow.getPushStartButton().setEnabled(true);
-                MainWindow.mainWindow.getScheduleRunButton().setEnabled(true);
-                MainWindow.mainWindow.getPushStopButton().setText("停止");
-                MainWindow.mainWindow.getPushStopButton().setEnabled(false);
-                MainWindow.mainWindow.getPushStartButton().updateUI();
-                MainWindow.mainWindow.getScheduleRunButton().updateUI();
-                MainWindow.mainWindow.getPushStopButton().updateUI();
+                PushForm.pushForm.getPushStartButton().setEnabled(true);
+                PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+                PushForm.pushForm.getPushStopButton().setText("停止");
+                PushForm.pushForm.getPushStopButton().setEnabled(false);
+                PushForm.pushForm.getPushStartButton().updateUI();
+                PushForm.pushForm.getScheduleRunButton().updateUI();
+                PushForm.pushForm.getPushStopButton().updateUI();
                 PushData.scheduling = false;
             }
 
             if (!PushData.running && PushData.fixRateScheduling) {
-                MainWindow.mainWindow.getScheduleDetailLabel().setText("");
+                PushForm.pushForm.getScheduleDetailLabel().setText("");
                 if (serviceStartPerDay != null) {
                     serviceStartPerDay.shutdownNow();
                 }
                 if (serviceStartPerWeek != null) {
                     serviceStartPerWeek.shutdownNow();
                 }
-                MainWindow.mainWindow.getPushStartButton().setEnabled(true);
-                MainWindow.mainWindow.getScheduleRunButton().setEnabled(true);
-                MainWindow.mainWindow.getPushStopButton().setText("停止");
-                MainWindow.mainWindow.getPushStopButton().setEnabled(false);
-                MainWindow.mainWindow.getPushStartButton().updateUI();
-                MainWindow.mainWindow.getScheduleRunButton().updateUI();
-                MainWindow.mainWindow.getPushStopButton().updateUI();
+                PushForm.pushForm.getPushStartButton().setEnabled(true);
+                PushForm.pushForm.getScheduleRunButton().setEnabled(true);
+                PushForm.pushForm.getPushStopButton().setText("停止");
+                PushForm.pushForm.getPushStopButton().setEnabled(false);
+                PushForm.pushForm.getPushStartButton().updateUI();
+                PushForm.pushForm.getScheduleRunButton().updateUI();
+                PushForm.pushForm.getPushStopButton().updateUI();
                 PushData.fixRateScheduling = false;
             }
 
             if (PushData.running) {
-                int isStop = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getPushPanel(),
+                int isStop = JOptionPane.showConfirmDialog(PushForm.pushForm.getPushPanel(),
                         "确定停止当前的推送吗?", "确认停止?",
                         JOptionPane.YES_NO_OPTION);
                 if (isStop == JOptionPane.YES_OPTION) {
@@ -104,40 +107,40 @@ public static void addListeners() {
         });
 
         // 按计划执行按钮事件
-        MainWindow.mainWindow.getScheduleRunButton().addActionListener((e -> ThreadUtil.execute(() -> {
+        PushForm.pushForm.getScheduleRunButton().addActionListener((e -> ThreadUtil.execute(() -> {
             if (checkBeforePush()) {
 
                 // 看是否存在设置的计划任务
                 boolean existScheduleTask = false;
 
                 // 定时开始
-                if (Init.configer.isRadioStartAt()) {
-                    long startAtMills = DateUtil.parse(Init.configer.getTextStartAt(), DatePattern.NORM_DATETIME_PATTERN).getTime();
+                if (Init.config.isRadioStartAt()) {
+                    long startAtMills = DateUtil.parse(Init.config.getTextStartAt(), DatePattern.NORM_DATETIME_PATTERN).getTime();
                     if (startAtMills < System.currentTimeMillis()) {
-                        JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(), "计划开始推送时间不能小于系统当前时间!\n\n请检查计划任务设置!\n\n", "提示",
+                        JOptionPane.showMessageDialog(PushForm.pushForm.getPushPanel(), "计划开始推送时间不能小于系统当前时间!\n\n请检查计划任务设置!\n\n", "提示",
                                 JOptionPane.INFORMATION_MESSAGE);
                         return;
                     }
 
-                    int isSchedulePush = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getPushPanel(),
+                    int isSchedulePush = JOptionPane.showConfirmDialog(PushForm.pushForm.getPushPanel(),
                             "将在" +
-                                    Init.configer.getTextStartAt() +
+                                    Init.config.getTextStartAt() +
                                     "推送\n\n消息:" +
-                                    MainWindow.mainWindow.getMsgNameField().getText() +
+                                    MessageEditForm.messageEditForm.getMsgNameField().getText() +
                                     "\n\n推送人数:" + PushData.allUser.size() +
                                     "\n\n空跑模式:" +
-                                    MainWindow.mainWindow.getDryRunCheckBox().isSelected(), "确认定时推送?",
+                                    PushForm.pushForm.getDryRunCheckBox().isSelected(), "确认定时推送?",
                             JOptionPane.YES_NO_OPTION);
                     if (isSchedulePush == JOptionPane.YES_OPTION) {
                         PushData.scheduling = true;
                         // 按钮状态
-                        MainWindow.mainWindow.getScheduleRunButton().setEnabled(false);
-                        MainWindow.mainWindow.getPushStartButton().setEnabled(false);
-                        MainWindow.mainWindow.getPushStopButton().setText("停止计划任务");
-                        MainWindow.mainWindow.getPushStopButton().setEnabled(true);
+                        PushForm.pushForm.getScheduleRunButton().setEnabled(false);
+                        PushForm.pushForm.getPushStartButton().setEnabled(false);
+                        PushForm.pushForm.getPushStopButton().setText("停止计划任务");
+                        PushForm.pushForm.getPushStopButton().setEnabled(true);
 
-                        MainWindow.mainWindow.getScheduleDetailLabel().setText("计划任务执行中:将在" +
-                                Init.configer.getTextStartAt() +
+                        PushForm.pushForm.getScheduleDetailLabel().setText("计划任务执行中:将在" +
+                                Init.config.getTextStartAt() +
                                 "开始推送");
 
                         serviceStartAt = Executors.newSingleThreadScheduledExecutor();
@@ -147,28 +150,28 @@ public static void addListeners() {
                 }
 
                 // 每天固定时间开始
-                if (Init.configer.isRadioPerDay()) {
-                    long startPerDayMills = DateUtil.parse(DateUtil.today() + " " + Init.configer.getTextPerDay(), DatePattern.NORM_DATETIME_PATTERN).getTime();
+                if (Init.config.isRadioPerDay()) {
+                    long startPerDayMills = DateUtil.parse(DateUtil.today() + " " + Init.config.getTextPerDay(), DatePattern.NORM_DATETIME_PATTERN).getTime();
 
-                    int isSchedulePush = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getPushPanel(),
+                    int isSchedulePush = JOptionPane.showConfirmDialog(PushForm.pushForm.getPushPanel(),
                             "将在每天" +
-                                    Init.configer.getTextPerDay() +
+                                    Init.config.getTextPerDay() +
                                     "推送\n\n消息:" +
-                                    MainWindow.mainWindow.getMsgNameField().getText() +
+                                    MessageEditForm.messageEditForm.getMsgNameField().getText() +
                                     "\n\n推送人数:" + PushData.allUser.size() +
                                     "\n\n空跑模式:" +
-                                    MainWindow.mainWindow.getDryRunCheckBox().isSelected(), "确认定时推送?",
+                                    PushForm.pushForm.getDryRunCheckBox().isSelected(), "确认定时推送?",
                             JOptionPane.YES_NO_OPTION);
                     if (isSchedulePush == JOptionPane.YES_OPTION) {
                         PushData.fixRateScheduling = true;
                         // 按钮状态
-                        MainWindow.mainWindow.getScheduleRunButton().setEnabled(false);
-                        MainWindow.mainWindow.getPushStartButton().setEnabled(false);
-                        MainWindow.mainWindow.getPushStopButton().setText("停止计划任务");
-                        MainWindow.mainWindow.getPushStopButton().setEnabled(true);
+                        PushForm.pushForm.getScheduleRunButton().setEnabled(false);
+                        PushForm.pushForm.getPushStartButton().setEnabled(false);
+                        PushForm.pushForm.getPushStopButton().setText("停止计划任务");
+                        PushForm.pushForm.getPushStopButton().setEnabled(true);
 
-                        MainWindow.mainWindow.getScheduleDetailLabel().setText("计划任务执行中:将在每天" +
-                                Init.configer.getTextPerDay() +
+                        PushForm.pushForm.getScheduleDetailLabel().setText("计划任务执行中:将在每天" +
+                                Init.config.getTextPerDay() +
                                 "开始推送");
 
                         serviceStartPerDay = Executors.newSingleThreadScheduledExecutor();
@@ -180,32 +183,32 @@ public static void addListeners() {
                 }
 
                 // 每周固定时间开始
-                if (Init.configer.isRadioPerWeek()) {
+                if (Init.config.isRadioPerWeek()) {
 
-                    long todaySetMills = DateUtil.parse(DateUtil.today() + " " + Init.configer.getTextPerWeekTime(), DatePattern.NORM_DATETIME_PATTERN).getTime();
-                    int dayBetween = getDayOfWeek(Init.configer.getTextPerWeekWeek()) - DateUtil.thisDayOfWeek();
+                    long todaySetMills = DateUtil.parse(DateUtil.today() + " " + Init.config.getTextPerWeekTime(), DatePattern.NORM_DATETIME_PATTERN).getTime();
+                    int dayBetween = getDayOfWeek(Init.config.getTextPerWeekWeek()) - DateUtil.thisDayOfWeek();
                     long startPerWeekMills = dayBetween < 0 ? (dayBetween + 7) * 24 * 60 * 60 * 1000 : dayBetween * 24 * 60 * 60 * 1000;
 
-                    int isSchedulePush = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getPushPanel(),
-                            "将在每周" + Init.configer.getTextPerWeekWeek() +
-                                    Init.configer.getTextPerWeekTime() +
+                    int isSchedulePush = JOptionPane.showConfirmDialog(PushForm.pushForm.getPushPanel(),
+                            "将在每周" + Init.config.getTextPerWeekWeek() +
+                                    Init.config.getTextPerWeekTime() +
                                     "推送\n\n消息:" +
-                                    MainWindow.mainWindow.getMsgNameField().getText() +
+                                    MessageEditForm.messageEditForm.getMsgNameField().getText() +
                                     "\n\n推送人数:" + PushData.allUser.size() +
                                     "\n\n空跑模式:" +
-                                    MainWindow.mainWindow.getDryRunCheckBox().isSelected(), "确认定时推送?",
+                                    PushForm.pushForm.getDryRunCheckBox().isSelected(), "确认定时推送?",
                             JOptionPane.YES_NO_OPTION);
                     if (isSchedulePush == JOptionPane.YES_OPTION) {
                         PushData.fixRateScheduling = true;
                         // 按钮状态
-                        MainWindow.mainWindow.getScheduleRunButton().setEnabled(false);
-                        MainWindow.mainWindow.getPushStartButton().setEnabled(false);
-                        MainWindow.mainWindow.getPushStopButton().setText("停止计划任务");
-                        MainWindow.mainWindow.getPushStopButton().setEnabled(true);
-
-                        MainWindow.mainWindow.getScheduleDetailLabel().setText("计划任务执行中:将在每周" +
-                                Init.configer.getTextPerWeekWeek() +
-                                Init.configer.getTextPerWeekTime() +
+                        PushForm.pushForm.getScheduleRunButton().setEnabled(false);
+                        PushForm.pushForm.getPushStartButton().setEnabled(false);
+                        PushForm.pushForm.getPushStopButton().setText("停止计划任务");
+                        PushForm.pushForm.getPushStopButton().setEnabled(true);
+
+                        PushForm.pushForm.getScheduleDetailLabel().setText("计划任务执行中:将在每周" +
+                                Init.config.getTextPerWeekWeek() +
+                                Init.config.getTextPerWeekTime() +
                                 "开始推送");
 
                         serviceStartPerWeek = Executors.newSingleThreadScheduledExecutor();
@@ -217,20 +220,18 @@ public static void addListeners() {
                 }
 
                 if (!existScheduleTask) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(), "请先设置计划任务!", "提示",
+                    JOptionPane.showMessageDialog(PushForm.pushForm.getPushPanel(), "请先设置计划任务!", "提示",
                             JOptionPane.INFORMATION_MESSAGE);
                 }
             }
         })));
 
-        // 每页分配用户数失去焦点
-        MainWindow.mainWindow.getPushPageSizeTextField().addFocusListener(new FocusAdapter() {
+        // 线程池数失去焦点
+        PushForm.pushForm.getMaxThreadPoolTextField().addFocusListener(new FocusAdapter() {
             @Override
             public void focusLost(FocusEvent e) {
                 try {
-                    if (PushData.allUser != null && PushData.allUser.size() > 0) {
-                        refreshPushInfo();
-                    }
+                    tEvent();
                 } catch (Exception e1) {
                     logger.error(e1);
                 } finally {
@@ -239,75 +240,52 @@ public void focusLost(FocusEvent e) {
             }
         });
 
-        // 每页分配用户数键入回车
-        MainWindow.mainWindow.getPushPageSizeTextField().addKeyListener(new KeyAdapter() {
+        // 线程池数键入回车
+        PushForm.pushForm.getMaxThreadPoolTextField().addKeyListener(new KeyAdapter() {
             @Override
             public void keyPressed(KeyEvent e) {
-                if (e.getKeyCode() == KeyEvent.VK_ENTER) {
-                    try {
-                        if (PushData.allUser != null && PushData.allUser.size() > 0) {
-                            refreshPushInfo();
-                        }
-                    } catch (Exception e1) {
-                        logger.error(e1);
-                    } finally {
-                        super.keyPressed(e);
-                    }
-                }
-            }
-        });
-
-        // 每个线程分配的页数失去焦点
-        MainWindow.mainWindow.getPushPagePerThreadTextField().addFocusListener(new FocusAdapter() {
-            @Override
-            public void focusLost(FocusEvent e) {
                 try {
-                    if (PushData.allUser != null && PushData.allUser.size() > 0) {
-                        refreshPushInfo();
-                    }
+                    tEvent();
                 } catch (Exception e1) {
                     logger.error(e1);
                 } finally {
-                    super.focusLost(e);
+                    super.keyPressed(e);
                 }
             }
         });
 
-        // 每个线程分配的页数键入回车
-        MainWindow.mainWindow.getPushPagePerThreadTextField().addKeyListener(new KeyAdapter() {
-            @Override
-            public void keyPressed(KeyEvent e) {
-                if (e.getKeyCode() == KeyEvent.VK_ENTER) {
-                    try {
-                        if (PushData.allUser != null && PushData.allUser.size() > 0) {
-                            refreshPushInfo();
-                        }
-                    } catch (Exception e1) {
-                        logger.error(e1);
-                    } finally {
-                        super.keyPressed(e);
-                    }
-                }
-            }
+        // 线程数滑块
+        PushForm.pushForm.getThreadCountSlider().addChangeListener(e -> {
+            int slideValue = PushForm.pushForm.getThreadCountSlider().getValue();
+            PushForm.pushForm.getThreadCountTextField().setText(String.valueOf(slideValue));
+            Init.config.setThreadCount(slideValue);
+            refreshPushInfo();
         });
 
     }
 
+    private static void tEvent() {
+        if (Integer.parseInt(PushForm.pushForm.getMaxThreadPoolTextField().getText()) > 1000) {
+            JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "最大输入1000", "提示",
+                    JOptionPane.INFORMATION_MESSAGE);
+            PushForm.pushForm.getMaxThreadPoolTextField().setText("1000");
+        }
+        PushForm.pushForm.getThreadCountSlider().setMaximum(Integer.parseInt(PushForm.pushForm.getMaxThreadPoolTextField().getText()));
+        refreshPushInfo();
+    }
+
     static void refreshPushInfo() {
-        // 页大小
-        int pageSize = Integer.parseInt(MainWindow.mainWindow.getPushPageSizeTextField().getText());
         // 总记录数
         long totalCount = PushData.allUser.size();
-        MainWindow.mainWindow.getPushTotalCountLabel().setText("总用户数:" + totalCount);
-        MainWindow.mainWindow.getPushTotalProgressBar().setMaximum((int) totalCount);
-        // 总页数
-        int totalPage = Long.valueOf((totalCount + pageSize - 1) / pageSize).intValue();
-        MainWindow.mainWindow.getPushTotalPageLabel().setText("总页数:" + totalPage);
-        // 每个线程分配多少页
-        int pagePerThread = Integer.parseInt(MainWindow.mainWindow.getPushPagePerThreadTextField().getText());
-        // 需要多少个线程
-        int threadCount = (totalPage + pagePerThread - 1) / pagePerThread;
-        MainWindow.mainWindow.getPushTotalThreadLabel().setText("需要线程宝宝个数:" + threadCount);
+        PushForm.pushForm.getPushTotalCountLabel().setText("消息总数:" + totalCount);
+        // 每个线程平均分配
+        int threadCount = Integer.parseInt(PushForm.pushForm.getThreadCountTextField().getText());
+        int perThread = (int) (totalCount / threadCount) + 1;
+        PushForm.pushForm.getCountPerThread().setText("每个线程平均分配:" + perThread);
+        // 可用处理器核心
+        PushForm.pushForm.getAvailableProcessorLabel().setText("可用处理器核心:" + Runtime.getRuntime().availableProcessors());
+        // JVM内存占用
+        PushForm.pushForm.getJvmMemoryLabel().setText("JVM内存占用:" + FileUtil.readableFileSize(Runtime.getRuntime().totalMemory()) + "/" + FileUtil.readableFileSize(Runtime.getRuntime().maxMemory()));
     }
 
     /**
@@ -317,25 +295,25 @@ static void refreshPushInfo() {
      */
     private static boolean checkBeforePush() {
         if (PushData.allUser == null || PushData.allUser.size() == 0) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(), "请先准备目标用户!", "提示",
+            JOptionPane.showMessageDialog(PushForm.pushForm.getPushPanel(), "请先准备目标用户!", "提示",
                     JOptionPane.INFORMATION_MESSAGE);
 
             return false;
         }
-        if ("0".equals(MainWindow.mainWindow.getPushPageSizeTextField().getText()) || StringUtils.isEmpty(MainWindow.mainWindow.getPushPageSizeTextField().getText())) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(), "请设置每页分配用户数!", "提示",
+        if ("0".equals(PushForm.pushForm.getMaxThreadPoolTextField().getText()) || StringUtils.isEmpty(PushForm.pushForm.getMaxThreadPoolTextField().getText())) {
+            JOptionPane.showMessageDialog(PushForm.pushForm.getPushPanel(), "请设置每页分配用户数!", "提示",
                     JOptionPane.INFORMATION_MESSAGE);
 
             return false;
         }
-        if ("0".equals(MainWindow.mainWindow.getPushPagePerThreadTextField().getText()) || StringUtils.isEmpty(MainWindow.mainWindow.getPushPagePerThreadTextField().getText())) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(), "请设置每个线程分配的页数!", "提示",
+        if ("0".equals(PushForm.pushForm.getThreadCountTextField().getText()) || StringUtils.isEmpty(PushForm.pushForm.getThreadCountTextField().getText())) {
+            JOptionPane.showMessageDialog(PushForm.pushForm.getPushPanel(), "请设置每个线程分配的页数!", "提示",
                     JOptionPane.INFORMATION_MESSAGE);
 
             return false;
         }
-        if (StringUtils.isEmpty(MainWindow.mainWindow.getMsgNameField().getText())) {
-            JOptionPane.showMessageDialog(MainWindow.mainWindow.getPushPanel(), "请先编辑消息!", "提示",
+        if (StringUtils.isEmpty(MessageEditForm.messageEditForm.getMsgNameField().getText())) {
+            JOptionPane.showMessageDialog(PushForm.pushForm.getPushPanel(), "请先编辑消息!", "提示",
                     JOptionPane.INFORMATION_MESSAGE);
 
             return false;
diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/ScheduleListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/ScheduleListener.java
index 41c9c95a..6c6bf43d 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/listener/ScheduleListener.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/listener/ScheduleListener.java
@@ -5,6 +5,7 @@
 import cn.hutool.log.LogFactory;
 import com.fangxuele.tool.push.ui.Init;
 import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.ScheduleForm;
 import org.apache.commons.lang3.StringUtils;
 
 import javax.swing.*;
@@ -22,10 +23,10 @@ public class ScheduleListener {
     private static final Log logger = LogFactory.get();
 
     public static void addListeners() {
-        MainWindow.mainWindow.getScheduleSaveButton().addActionListener(e -> {
+        ScheduleForm.scheduleForm.getScheduleSaveButton().addActionListener(e -> {
             try {
-                String textStartAt = MainWindow.mainWindow.getStartAtThisTimeTextField().getText();
-                boolean isStartAt = MainWindow.mainWindow.getRunAtThisTimeRadioButton().isSelected();
+                String textStartAt = ScheduleForm.scheduleForm.getStartAtThisTimeTextField().getText();
+                boolean isStartAt = ScheduleForm.scheduleForm.getRunAtThisTimeRadioButton().isSelected();
                 if (StringUtils.isNotEmpty(textStartAt)) {
                     if (DateUtil.parse(textStartAt).getTime() <= System.currentTimeMillis() && isStartAt) {
                         JOptionPane.showMessageDialog(MainWindow.mainWindow.getSchedulePanel(),
@@ -33,53 +34,53 @@ public static void addListeners() {
                                 JOptionPane.ERROR_MESSAGE);
                         return;
                     }
-                    Init.configer.setRadioStartAt(isStartAt);
-                    Init.configer.setTextStartAt(textStartAt);
+                    Init.config.setRadioStartAt(isStartAt);
+                    Init.config.setTextStartAt(textStartAt);
                 } else if (isStartAt) {
                     JOptionPane.showMessageDialog(MainWindow.mainWindow.getSchedulePanel(),
                             "保存失败!\n\n开始推送时间不能为空!", "失败",
                             JOptionPane.ERROR_MESSAGE);
                     return;
                 } else {
-                    Init.configer.setRadioStartAt(isStartAt);
-                    Init.configer.setTextStartAt(textStartAt);
+                    Init.config.setRadioStartAt(isStartAt);
+                    Init.config.setTextStartAt(textStartAt);
                 }
 
-                String textPerDay = MainWindow.mainWindow.getStartPerDayTextField().getText();
-                boolean isPerDay = MainWindow.mainWindow.getRunPerDayRadioButton().isSelected();
+                String textPerDay = ScheduleForm.scheduleForm.getStartPerDayTextField().getText();
+                boolean isPerDay = ScheduleForm.scheduleForm.getRunPerDayRadioButton().isSelected();
                 if (StringUtils.isNotEmpty(textPerDay)) {
                     DateUtil.parse(textPerDay);
-                    Init.configer.setRadioPerDay(isPerDay);
-                    Init.configer.setTextPerDay(textPerDay);
+                    Init.config.setRadioPerDay(isPerDay);
+                    Init.config.setTextPerDay(textPerDay);
                 } else if (isPerDay) {
                     JOptionPane.showMessageDialog(MainWindow.mainWindow.getSchedulePanel(),
                             "保存失败!\n\n每天固定推送时间不能为空!", "失败",
                             JOptionPane.ERROR_MESSAGE);
                     return;
                 } else {
-                    Init.configer.setRadioPerDay(isPerDay);
-                    Init.configer.setTextPerDay(textPerDay);
+                    Init.config.setRadioPerDay(isPerDay);
+                    Init.config.setTextPerDay(textPerDay);
                 }
 
-                String textPerWeekTime = MainWindow.mainWindow.getStartPerWeekTextField().getText();
-                boolean isPerWeek = MainWindow.mainWindow.getRunPerWeekRadioButton().isSelected();
+                String textPerWeekTime = ScheduleForm.scheduleForm.getStartPerWeekTextField().getText();
+                boolean isPerWeek = ScheduleForm.scheduleForm.getRunPerWeekRadioButton().isSelected();
                 if (StringUtils.isNotEmpty(textPerWeekTime)) {
                     DateUtil.parse(textPerWeekTime);
-                    Init.configer.setRadioPerWeek(isPerWeek);
-                    Init.configer.setTextPerWeekWeek(Objects.requireNonNull(MainWindow.mainWindow.getSchedulePerWeekComboBox().getSelectedItem()).toString());
-                    Init.configer.setTextPerWeekTime(textPerWeekTime);
+                    Init.config.setRadioPerWeek(isPerWeek);
+                    Init.config.setTextPerWeekWeek(Objects.requireNonNull(ScheduleForm.scheduleForm.getSchedulePerWeekComboBox().getSelectedItem()).toString());
+                    Init.config.setTextPerWeekTime(textPerWeekTime);
                 } else if (isPerWeek) {
                     JOptionPane.showMessageDialog(MainWindow.mainWindow.getSchedulePanel(),
                             "保存失败!\n\n每周固定推送时间不能为空!", "失败",
                             JOptionPane.ERROR_MESSAGE);
                     return;
                 } else {
-                    Init.configer.setRadioPerWeek(isPerWeek);
-                    Init.configer.setTextPerWeekWeek(Objects.requireNonNull(MainWindow.mainWindow.getSchedulePerWeekComboBox().getSelectedItem()).toString());
-                    Init.configer.setTextPerWeekTime(textPerWeekTime);
+                    Init.config.setRadioPerWeek(isPerWeek);
+                    Init.config.setTextPerWeekWeek(Objects.requireNonNull(ScheduleForm.scheduleForm.getSchedulePerWeekComboBox().getSelectedItem()).toString());
+                    Init.config.setTextPerWeekTime(textPerWeekTime);
                 }
 
-                Init.configer.save();
+                Init.config.save();
                 JOptionPane.showMessageDialog(MainWindow.mainWindow.getSchedulePanel(), "保存成功!\n\n将在下一次按计划执行时生效!\n\n", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
@@ -88,24 +89,24 @@ public static void addListeners() {
             }
         });
 
-        MainWindow.mainWindow.getRunAtThisTimeRadioButton().addActionListener(e -> {
-            if (MainWindow.mainWindow.getRunAtThisTimeRadioButton().isSelected()) {
-                MainWindow.mainWindow.getRunPerDayRadioButton().setSelected(false);
-                MainWindow.mainWindow.getRunPerWeekRadioButton().setSelected(false);
+        ScheduleForm.scheduleForm.getRunAtThisTimeRadioButton().addActionListener(e -> {
+            if (ScheduleForm.scheduleForm.getRunAtThisTimeRadioButton().isSelected()) {
+                ScheduleForm.scheduleForm.getRunPerDayRadioButton().setSelected(false);
+                ScheduleForm.scheduleForm.getRunPerWeekRadioButton().setSelected(false);
             }
         });
 
-        MainWindow.mainWindow.getRunPerDayRadioButton().addActionListener(e -> {
-            if (MainWindow.mainWindow.getRunPerDayRadioButton().isSelected()) {
-                MainWindow.mainWindow.getRunAtThisTimeRadioButton().setSelected(false);
-                MainWindow.mainWindow.getRunPerWeekRadioButton().setSelected(false);
+        ScheduleForm.scheduleForm.getRunPerDayRadioButton().addActionListener(e -> {
+            if (ScheduleForm.scheduleForm.getRunPerDayRadioButton().isSelected()) {
+                ScheduleForm.scheduleForm.getRunAtThisTimeRadioButton().setSelected(false);
+                ScheduleForm.scheduleForm.getRunPerWeekRadioButton().setSelected(false);
             }
         });
 
-        MainWindow.mainWindow.getRunPerWeekRadioButton().addActionListener(e -> {
-            if (MainWindow.mainWindow.getRunPerWeekRadioButton().isSelected()) {
-                MainWindow.mainWindow.getRunAtThisTimeRadioButton().setSelected(false);
-                MainWindow.mainWindow.getRunPerDayRadioButton().setSelected(false);
+        ScheduleForm.scheduleForm.getRunPerWeekRadioButton().addActionListener(e -> {
+            if (ScheduleForm.scheduleForm.getRunPerWeekRadioButton().isSelected()) {
+                ScheduleForm.scheduleForm.getRunAtThisTimeRadioButton().setSelected(false);
+                ScheduleForm.scheduleForm.getRunPerDayRadioButton().setSelected(false);
             }
         });
     }
diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/SettingListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/SettingListener.java
index 21ddcbbc..f1543dc5 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/listener/SettingListener.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/listener/SettingListener.java
@@ -1,19 +1,16 @@
 package com.fangxuele.tool.push.ui.listener;
 
-import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
 import com.fangxuele.tool.push.App;
 import com.fangxuele.tool.push.ui.Init;
 import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.SettingForm;
 import com.fangxuele.tool.push.util.DbUtilMySQL;
-import com.fangxuele.tool.push.util.SystemUtil;
+import org.apache.commons.lang3.StringUtils;
 
 import javax.swing.*;
-import javax.swing.table.DefaultTableModel;
-import java.io.File;
 import java.sql.Connection;
-import java.util.Map;
 import java.util.Objects;
 
 /**
@@ -27,254 +24,186 @@
 public class SettingListener {
     private static final Log logger = LogFactory.get();
 
-    private static boolean selectAllToggle = false;
-
     public static void addListeners() {
 
         // 设置-常规-启动时自动检查更新
-        MainWindow.mainWindow.getAutoCheckUpdateCheckBox().addActionListener(e -> {
-            Init.configer.setAutoCheckUpdate(MainWindow.mainWindow.getAutoCheckUpdateCheckBox().isSelected());
-            Init.configer.save();
+        SettingForm.settingForm.getAutoCheckUpdateCheckBox().addActionListener(e -> {
+            Init.config.setAutoCheckUpdate(SettingForm.settingForm.getAutoCheckUpdateCheckBox().isSelected());
+            Init.config.save();
         });
 
         // 设置-公众号-保存
-        MainWindow.mainWindow.getSettingMpInfoSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingMpInfoSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setWechatAppId(MainWindow.mainWindow.getWechatAppIdTextField().getText());
-                Init.configer.setWechatAppSecret(new String(MainWindow.mainWindow.getWechatAppSecretPasswordField().getPassword()));
-                Init.configer.setWechatToken(new String(MainWindow.mainWindow.getWechatTokenPasswordField().getPassword()));
-                Init.configer.setWechatAesKey(new String(MainWindow.mainWindow.getWechatAesKeyPasswordField().getPassword()));
-                Init.configer.save();
+                Init.config.setWechatAppId(SettingForm.settingForm.getWechatAppIdTextField().getText());
+                Init.config.setWechatAppSecret(new String(SettingForm.settingForm.getWechatAppSecretPasswordField().getPassword()));
+                Init.config.setWechatToken(new String(SettingForm.settingForm.getWechatTokenPasswordField().getPassword()));
+                Init.config.setWechatAesKey(new String(SettingForm.settingForm.getWechatAesKeyPasswordField().getPassword()));
+                Init.config.save();
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // 设置-小程序-保存
-        MainWindow.mainWindow.getSettingMaInfoSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingMaInfoSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setMiniAppAppId(MainWindow.mainWindow.getMiniAppAppIdTextField().getText());
-                Init.configer.setMiniAppAppSecret(new String(MainWindow.mainWindow.getMiniAppAppSecretPasswordField().getPassword()));
-                Init.configer.setMiniAppToken(new String(MainWindow.mainWindow.getMiniAppTokenPasswordField().getPassword()));
-                Init.configer.setMiniAppAesKey(new String(MainWindow.mainWindow.getMiniAppAesKeyPasswordField().getPassword()));
-                Init.configer.save();
+                Init.config.setMiniAppAppId(SettingForm.settingForm.getMiniAppAppIdTextField().getText());
+                Init.config.setMiniAppAppSecret(new String(SettingForm.settingForm.getMiniAppAppSecretPasswordField().getPassword()));
+                Init.config.setMiniAppToken(new String(SettingForm.settingForm.getMiniAppTokenPasswordField().getPassword()));
+                Init.config.setMiniAppAesKey(new String(SettingForm.settingForm.getMiniAppAesKeyPasswordField().getPassword()));
+                Init.config.save();
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // 设置-阿里云短信-保存
-        MainWindow.mainWindow.getSettingAliyunSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingAliyunSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setAliyunAccessKeyId(MainWindow.mainWindow.getAliyunAccessKeyIdTextField().getText());
-                Init.configer.setAliyunAccessKeySecret(new String(MainWindow.mainWindow.getAliyunAccessKeySecretTextField().getPassword()));
-                Init.configer.setAliyunSign(MainWindow.mainWindow.getAliyunSignTextField().getText());
-                Init.configer.save();
+                Init.config.setAliyunAccessKeyId(SettingForm.settingForm.getAliyunAccessKeyIdTextField().getText());
+                Init.config.setAliyunAccessKeySecret(new String(SettingForm.settingForm.getAliyunAccessKeySecretTextField().getPassword()));
+                Init.config.setAliyunSign(SettingForm.settingForm.getAliyunSignTextField().getText());
+                Init.config.save();
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // 设置-阿里大于-保存
-        MainWindow.mainWindow.getSettingAliInfoSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingAliInfoSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setAliServerUrl(MainWindow.mainWindow.getAliServerUrlTextField().getText());
-                Init.configer.setAliAppKey(new String(MainWindow.mainWindow.getAliAppKeyPasswordField().getPassword()));
-                Init.configer.setAliAppSecret(new String(MainWindow.mainWindow.getAliAppSecretPasswordField().getPassword()));
-                Init.configer.setAliSign(MainWindow.mainWindow.getAliSignTextField().getText());
-                Init.configer.save();
+                Init.config.setAliServerUrl(SettingForm.settingForm.getAliServerUrlTextField().getText());
+                Init.config.setAliAppKey(new String(SettingForm.settingForm.getAliAppKeyPasswordField().getPassword()));
+                Init.config.setAliAppSecret(new String(SettingForm.settingForm.getAliAppSecretPasswordField().getPassword()));
+                Init.config.setAliSign(SettingForm.settingForm.getAliSignTextField().getText());
+                Init.config.save();
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // 设置-腾讯云短信-保存
-        MainWindow.mainWindow.getSettingTxyunSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingTxyunSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setTxyunAppId(MainWindow.mainWindow.getTxyunAppIdTextField().getText());
-                Init.configer.setTxyunAppKey(new String(MainWindow.mainWindow.getTxyunAppKeyTextField().getPassword()));
-                Init.configer.setTxyunSign(MainWindow.mainWindow.getTxyunSignTextField().getText());
-                Init.configer.save();
+                Init.config.setTxyunAppId(SettingForm.settingForm.getTxyunAppIdTextField().getText());
+                Init.config.setTxyunAppKey(new String(SettingForm.settingForm.getTxyunAppKeyTextField().getPassword()));
+                Init.config.setTxyunSign(SettingForm.settingForm.getTxyunSignTextField().getText());
+                Init.config.save();
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // 设置-云片网短信-保存
-        MainWindow.mainWindow.getSettingYunpianSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingYunpianSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setYunpianApiKey(new String(MainWindow.mainWindow.getYunpianApiKeyTextField().getPassword()));
-                Init.configer.save();
+                Init.config.setYunpianApiKey(new String(SettingForm.settingForm.getYunpianApiKeyTextField().getPassword()));
+                Init.config.save();
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // mysql数据库-测试链接
-        MainWindow.mainWindow.getSettingTestDbLinkButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingTestDbLinkButton().addActionListener(e -> {
             try {
+                String dbUrl = SettingForm.settingForm.getMysqlUrlTextField().getText();
+                String dbName = SettingForm.settingForm.getMysqlDatabaseTextField().getText();
+                String dbUser = SettingForm.settingForm.getMysqlUserTextField().getText();
+                String dbPassword = new String(SettingForm.settingForm.getMysqlPasswordField().getPassword());
+                if (StringUtils.isEmpty(dbUrl) || StringUtils.isEmpty(dbName)
+                        || StringUtils.isEmpty(dbUser) || StringUtils.isEmpty(dbPassword)) {
+                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
+                            "请先在设置中填写并保存MySQL数据库相关配置!", "提示",
+                            JOptionPane.INFORMATION_MESSAGE);
+                    return;
+                }
                 DbUtilMySQL dbMySQL = DbUtilMySQL.getInstance();
-                String dbUrl = MainWindow.mainWindow.getMysqlUrlTextField().getText();
-                String dbName = MainWindow.mainWindow.getMysqlDatabaseTextField().getText();
-                String dbUser = MainWindow.mainWindow.getMysqlUserTextField().getText();
-                String dbPassword = new String(MainWindow.mainWindow.getMysqlPasswordField().getPassword());
                 Connection conn = dbMySQL.testConnection(dbUrl, dbName, dbUser, dbPassword);
                 if (conn == null) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "连接失败", "失败",
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "连接失败", "失败",
                             JOptionPane.ERROR_MESSAGE);
                 } else {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "连接成功!", "成功",
+                    JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "连接成功!", "成功",
                             JOptionPane.INFORMATION_MESSAGE);
                 }
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "连接失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "连接失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // mysql数据库-保存
-        MainWindow.mainWindow.getSettingDbInfoSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingDbInfoSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setMysqlUrl(MainWindow.mainWindow.getMysqlUrlTextField().getText());
-                Init.configer.setMysqlDatabase(MainWindow.mainWindow.getMysqlDatabaseTextField().getText());
-                Init.configer.setMysqlUser(MainWindow.mainWindow.getMysqlUserTextField().getText());
-                Init.configer.setMysqlPassword(new String(MainWindow.mainWindow.getMysqlPasswordField().getPassword()));
-                Init.configer.save();
+                Init.config.setMysqlUrl(SettingForm.settingForm.getMysqlUrlTextField().getText());
+                Init.config.setMysqlDatabase(SettingForm.settingForm.getMysqlDatabaseTextField().getText());
+                Init.config.setMysqlUser(SettingForm.settingForm.getMysqlUserTextField().getText());
+                Init.config.setMysqlPassword(new String(SettingForm.settingForm.getMysqlPasswordField().getPassword()));
+                Init.config.save();
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
 
         // 外观-保存
-        MainWindow.mainWindow.getSettingAppearanceSaveButton().addActionListener(e -> {
+        SettingForm.settingForm.getSettingAppearanceSaveButton().addActionListener(e -> {
             try {
-                Init.configer.setTheme(Objects.requireNonNull(MainWindow.mainWindow.getSettingThemeComboBox().getSelectedItem()).toString());
-                Init.configer.setFont(Objects.requireNonNull(MainWindow.mainWindow.getSettingFontNameComboBox().getSelectedItem()).toString());
-                Init.configer.setFontSize(Integer.parseInt(Objects.requireNonNull(MainWindow.mainWindow.getSettingFontSizeComboBox().getSelectedItem()).toString()));
-                Init.configer.save();
+                Init.config.setTheme(Objects.requireNonNull(SettingForm.settingForm.getSettingThemeComboBox().getSelectedItem()).toString());
+                Init.config.setFont(Objects.requireNonNull(SettingForm.settingForm.getSettingFontNameComboBox().getSelectedItem()).toString());
+                Init.config.setFontSize(Integer.parseInt(Objects.requireNonNull(SettingForm.settingForm.getSettingFontSizeComboBox().getSelectedItem()).toString()));
+                Init.config.save();
 
                 Init.initTheme();
                 Init.initGlobalFont();
                 SwingUtilities.updateComponentTreeUI(App.mainFrame);
                 SwingUtilities.updateComponentTreeUI(MainWindow.mainWindow.getTabbedPane());
 
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存成功!\n\n部分细节将在下次启动时生效!\n\n", "成功",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存成功!\n\n部分细节将在下次启动时生效!\n\n", "成功",
                         JOptionPane.INFORMATION_MESSAGE);
             } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
+                JOptionPane.showMessageDialog(SettingForm.settingForm.getSettingPanel(), "保存失败!\n\n" + e1.getMessage(), "失败",
                         JOptionPane.ERROR_MESSAGE);
                 logger.error(e1);
             }
         });
-
-        // 历史消息管理-全选
-        MainWindow.mainWindow.getMsgHisTableSelectAllButton().addActionListener(e -> ThreadUtil.execute(() -> {
-            toggleSelectAll();
-            DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getMsgHistable()
-                    .getModel();
-            int rowCount = tableModel.getRowCount();
-            for (int i = 0; i < rowCount; i++) {
-                tableModel.setValueAt(selectAllToggle, i, 0);
-            }
-        }));
-
-        // 历史消息管理-删除
-        MainWindow.mainWindow.getMsgHisTableDeleteButton().addActionListener(e -> ThreadUtil.execute(() -> {
-            try {
-                DefaultTableModel tableModel = (DefaultTableModel) MainWindow.mainWindow.getMsgHistable()
-                        .getModel();
-                int rowCount = tableModel.getRowCount();
-
-                int selectedCount = 0;
-                for (int i = 0; i < rowCount; i++) {
-                    boolean isSelected = (boolean) tableModel.getValueAt(i, 0);
-                    if (isSelected) {
-                        selectedCount++;
-                    }
-                }
-
-                if (selectedCount == 0) {
-                    JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请至少选择一个!", "提示",
-                            JOptionPane.INFORMATION_MESSAGE);
-                } else {
-                    int isDelete = JOptionPane.showConfirmDialog(MainWindow.mainWindow.getSettingPanel(), "确认删除?", "确认",
-                            JOptionPane.YES_NO_OPTION);
-                    if (isDelete == JOptionPane.YES_OPTION) {
-                        Map msgMap = Init.msgHisManager.readMsgHis();
-                        for (int i = 0; i < rowCount; ) {
-                            boolean delete = (boolean) tableModel.getValueAt(i, 0);
-                            if (delete) {
-                                String msgName = (String) tableModel.getValueAt(i, 1);
-                                if (msgMap.containsKey(msgName)) {
-                                    msgMap.remove(msgName);
-                                    File msgTemplateDataFile = new File(SystemUtil.configHome + "data"
-                                            + File.separator + "template_data" + File.separator + msgName + ".csv");
-                                    if (msgTemplateDataFile.exists()) {
-                                        msgTemplateDataFile.delete();
-                                    }
-                                }
-                                tableModel.removeRow(i);
-                                MainWindow.mainWindow.getMsgHistable().updateUI();
-                                i = 0;
-                                rowCount = tableModel.getRowCount();
-                            } else {
-                                i++;
-                            }
-                        }
-                        Init.msgHisManager.writeMsgHis(msgMap);
-
-                        Init.initMsgTab(null);
-                    }
-                }
-            } catch (Exception e1) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "删除失败!\n\n" + e1.getMessage(), "失败",
-                        JOptionPane.ERROR_MESSAGE);
-                logger.error(e1);
-            }
-        }));
-
     }
 
-    /**
-     * 切换全选/全不选
-     */
-    private static void toggleSelectAll() {
-        selectAllToggle = !selectAllToggle;
-    }
 }
diff --git a/src/main/java/com/fangxuele/tool/push/ui/listener/TabListener.java b/src/main/java/com/fangxuele/tool/push/ui/listener/TabListener.java
index 2c6f8ec7..a11e1688 100644
--- a/src/main/java/com/fangxuele/tool/push/ui/listener/TabListener.java
+++ b/src/main/java/com/fangxuele/tool/push/ui/listener/TabListener.java
@@ -2,9 +2,10 @@
 
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
-import com.fangxuele.tool.push.logic.PushData;
-import com.fangxuele.tool.push.ui.Init;
 import com.fangxuele.tool.push.ui.form.MainWindow;
+import com.fangxuele.tool.push.ui.form.MessageEditForm;
+import com.fangxuele.tool.push.ui.form.PushForm;
+import com.fangxuele.tool.push.ui.form.PushHisForm;
 
 import javax.swing.*;
 import java.awt.event.MouseAdapter;
@@ -25,7 +26,6 @@ public class TabListener {
     private static boolean warnFlag = true;
 
     public static void addListeners() {
-        // 暂时停止使用,仅留作demo,日后需要时再使用
         MainWindow.mainWindow.getTabbedPane().addMouseListener(new MouseAdapter() {
             @Override
             public void mouseClicked(MouseEvent e) {
@@ -33,7 +33,7 @@ public void mouseClicked(MouseEvent e) {
                 int index = MainWindow.mainWindow.getTabbedPane().getSelectedIndex();
                 switch (index) {
                     case 6:
-                        Init.initPushHisTab();
+                        PushHisForm.init();
                         break;
                     case 3:
                         if (warnFlag) {
@@ -44,11 +44,8 @@ public void mouseClicked(MouseEvent e) {
                         }
                         break;
                     case 4:
-                        MainWindow.mainWindow.getPushMsgName().setText(MainWindow.mainWindow.getMsgNameField().getText());
-
-                        if (PushData.allUser != null && PushData.allUser.size() > 0) {
-                            PushListener.refreshPushInfo();
-                        }
+                        PushForm.pushForm.getPushMsgName().setText(MessageEditForm.messageEditForm.getMsgNameField().getText());
+                        PushListener.refreshPushInfo();
                         break;
                     default:
                         break;
diff --git a/src/main/java/com/fangxuele/tool/push/util/ConfigUtil.java b/src/main/java/com/fangxuele/tool/push/util/ConfigUtil.java
index 03ecbfe7..ad0f6d6b 100644
--- a/src/main/java/com/fangxuele/tool/push/util/ConfigUtil.java
+++ b/src/main/java/com/fangxuele/tool/push/util/ConfigUtil.java
@@ -1,14 +1,10 @@
 package com.fangxuele.tool.push.util;
 
-
 import cn.hutool.core.io.FileUtil;
-import cn.hutool.log.Log;
-import cn.hutool.log.LogFactory;
-import cn.hutool.setting.dialect.Props;
+import cn.hutool.core.util.CharsetUtil;
+import cn.hutool.setting.Setting;
 
 import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
 
 /**
  * 
@@ -19,53 +15,31 @@
  * @since 2017/6/14.
  */
 public class ConfigUtil {
+    /**
+     * 设置文件路径
+     */
+    private String settingFilePath = SystemUtil.configHome + "config" + File.separator + "config.setting";
 
-    private static final Log logger = LogFactory.get();
-
-    private File file;
+    private Setting setting;
 
-    private Props props;
+    private static ConfigUtil configUtil = new ConfigUtil();
 
-    private static ConfigUtil ourInstance = new ConfigUtil();
+    private int msgType;
 
     private String msgName;
 
     private String previewUser;
 
-    private int memberCount;
-
     private String memberSql;
 
     private String memberFilePath;
 
-    private int pushSuccess;
-
-    private int pushFail;
-
-    private long pushLastTime;
-
-    private long pushLeftTime;
+    private int maxThreadPool;
 
-    private int totalRecord;
-
-    private int totalPage;
-
-    private int totalThread;
-
-    private int recordPerPage;
-
-    private int pagePerThread;
+    private int threadCount;
 
     private boolean dryRun;
 
-    private boolean radioStartAt;
-
-    private String textStartAt;
-
-    private boolean radioStopAt;
-
-    private String textStopAt;
-
     private boolean radioPerDay;
 
     private String textPerDay;
@@ -131,527 +105,362 @@ public class ConfigUtil {
     private int fontSize;
 
     public static ConfigUtil getInstance() {
-        return ourInstance;
+        return configUtil;
     }
 
     private ConfigUtil() {
-        // --旧版本配置文件迁移初始化开始--
-        File configHomeDir = new File(SystemUtil.configHome);
-        if (!configHomeDir.exists()) {
-            configHomeDir.mkdirs();
-        }
-        File oldConfigDir = new File("config");
-        if (oldConfigDir.exists()) {
-            FileUtil.copy(oldConfigDir.getAbsolutePath(), SystemUtil.configHome, true);
-            FileUtil.del(oldConfigDir.getAbsolutePath());
-        }
-
-        File oldDataDir = new File("data");
-        if (oldDataDir.exists()) {
-            FileUtil.copy(oldDataDir.getAbsolutePath(), SystemUtil.configHome, true);
-            FileUtil.del(oldDataDir.getAbsolutePath());
-        }
-        // --旧版本配置文件迁移初始化结束--
-
-        file = new File(SystemUtil.configHome + "config" + File.separator + "config.properties");
-        File configDir = new File(SystemUtil.configHome + "config" + File.separator);
-        if (!file.exists()) {
-            try {
-                configDir.mkdirs();
-                file.createNewFile();
-                originInit();
-            } catch (IOException e) {
-                logger.error(e);
-            }
-        }
-        props = new Props(file);
+        setting = new Setting(FileUtil.touch(settingFilePath), CharsetUtil.CHARSET_UTF_8, false);
     }
 
     public void setProps(String key, String value) {
-        props.setProperty(key, value);
+        setting.put(key, value);
     }
 
     public String getProps(String key) {
-        return props.getProperty(key);
+        return setting.get(key);
     }
 
     /**
      * 存盘
      */
     public void save() {
-        try {
-            props.store(new FileOutputStream(file), null);
-        } catch (IOException e) {
-            logger.error(e);
-        }
+        setting.store(settingFilePath);
     }
 
-    /**
-     * 初始化原始数据
-     */
-    private void originInit() {
-        props = new Props(file);
-
-        props.setProperty("msg.msgName", "");
-        props.setProperty("msg.previewUser", "");
-        props.setProperty("member.count", "0");
-        props.setProperty("member.sql", "SELECT openid FROM");
-        props.setProperty("member.filePath", "");
-        props.setProperty("push.success", "0");
-        props.setProperty("push.fail", "0");
-        props.setProperty("push.lastTime", "0");
-        props.setProperty("push.leftTime", "0");
-        props.setProperty("push.totalRecord", "0");
-        props.setProperty("push.totalPage", "0");
-        props.setProperty("push.totalThread", "0");
-        props.setProperty("push.recordPerPage", "500");
-        props.setProperty("push.pagePerThread", "3");
-        props.setProperty("push.dryRun", "true");
-        props.setProperty("schedule.radioStartAt", "false");
-        props.setProperty("schedule.textStartAt", "");
-        props.setProperty("schedule.radioStopAt", "false");
-        props.setProperty("schedule.textStopAt", "");
-        props.setProperty("schedule.radioPerDay", "false");
-        props.setProperty("schedule.textPerDay", "");
-        props.setProperty("schedule.radioPerWeek", "false");
-        props.setProperty("schedule.textPerWeek.week", "一");
-        props.setProperty("schedule.textPerWeek.time", "");
-        props.setProperty("setting.normal.autoCheckUpdate", "true");
-        props.setProperty("setting.wechat.appId", "");
-        props.setProperty("setting.wechat.AppSecret", "");
-        props.setProperty("setting.wechat.token", "");
-        props.setProperty("setting.wechat.aesKey", "");
-        props.setProperty("setting.miniApp.appId", "");
-        props.setProperty("setting.miniApp.AppSecret", "");
-        props.setProperty("setting.miniApp.token", "");
-        props.setProperty("setting.miniApp.aesKey", "");
-        props.setProperty("setting.aliyun.accessKeyId", "");
-        props.setProperty("setting.aliyun.accessKeySecret", "");
-        props.setProperty("setting.aliyun.aliyunSign", "");
-        props.setProperty("setting.ali.serverUrl", "");
-        props.setProperty("setting.ali.appKey", "");
-        props.setProperty("setting.ali.appSecret", "");
-        props.setProperty("setting.ali.sign", "");
-        props.setProperty("setting.txyun.appId", "");
-        props.setProperty("setting.txyun.appKey", "");
-        props.setProperty("setting.txyun.txyunSign", "");
-        props.setProperty("setting.yunpian.apiKey", "");
-        props.setProperty("setting.mysql.url", "");
-        props.setProperty("setting.mysql.database", "");
-        props.setProperty("setting.mysql.user", "");
-        props.setProperty("setting.mysql.password", "");
-        props.setProperty("setting.appearance.theme", "Darcula(推荐)");
-        props.setProperty("setting.appearance.font", "Microsoft YaHei UI");
-        props.setProperty("setting.appearance.fontSize", "18");
-
-        save();
+    public int getMsgType() {
+        return setting.getInt("msgType", "msg", 1);
+    }
+
+    public void setMsgType(int msgType) {
+        setting.put("msg", "msgType", String.valueOf(msgType));
     }
 
+
     public String getMsgName() {
-        return props.getProperty("msg.msgName");
+        return setting.getStr("msgName", "msg", "");
     }
 
     public void setMsgName(String msgName) {
-        props.setProperty("msg.msgName", msgName);
+        setting.put("msg", "msgName", msgName);
     }
 
     public String getPreviewUser() {
-        return props.getProperty("msg.previewUser");
+        return setting.getStr("previewUser", "msg", "");
     }
 
     public void setPreviewUser(String previewUser) {
-        props.setProperty("msg.previewUser", previewUser);
-    }
-
-    public int getMemberCount() {
-        return props.getInt("member.count");
-    }
-
-    public void setMemberCount(int memberCount) {
-        props.setProperty("member.count", memberCount);
+        setting.put("msg", "previewUser", previewUser);
     }
 
     public String getMemberSql() {
-        return props.getProperty("member.sql");
+        return setting.getStr("sql", "member", "");
     }
 
     public void setMemberSql(String memberSql) {
-        props.setProperty("member.sql", memberSql);
+        setting.put("member", "sql", memberSql);
     }
 
     public String getMemberFilePath() {
-        return props.getProperty("member.filePath");
+        return setting.getStr("filePath", "member", "");
     }
 
     public void setMemberFilePath(String memberFilePath) {
-        props.setProperty("member.filePath", memberFilePath);
-    }
-
-    public int getPushSuccess() {
-        return props.getInt("push.success");
-    }
-
-    public void setPushSuccess(int pushSuccess) {
-        props.setProperty("push.success", pushSuccess);
-    }
-
-    public int getPushFail() {
-        return props.getInt("push.fail");
+        setting.put("member", "filePath", memberFilePath);
     }
 
-    public void setPushFail(int pushFail) {
-        props.setProperty("push.fail", pushFail);
+    public int getMaxThreadPool() {
+        return setting.getInt("maxThreadPool", "push", 100);
     }
 
-    public long getPushLastTime() {
-        return props.getLong("push.lastTime");
+    public void setMaxThreadPool(int maxThreadPool) {
+        setting.put("push", "maxThreadPool", String.valueOf(maxThreadPool));
     }
 
-    public void setPushLastTime(long pushLastTime) {
-        props.setProperty("push.lastTime", pushLastTime);
+    public int getThreadCount() {
+        return setting.getInt("threadCount", "push", 60);
     }
 
-    public long getPushLeftTime() {
-        return props.getLong("push.leftTime");
-    }
-
-    public void setPushLeftTime(long pushLeftTime) {
-        props.setProperty("push.leftTime", pushLeftTime);
-    }
-
-    public int getTotalRecord() {
-        return props.getInt("push.totalRecord");
-    }
-
-    public void setTotalRecord(int totalRecord) {
-        props.setProperty("push.totalRecord", totalRecord);
-    }
-
-    public int getTotalPage() {
-        return props.getInt("push.totalPage");
-    }
-
-    public void setTotalPage(int totalPage) {
-        props.setProperty("push.totalPage", totalPage);
-    }
-
-    public int getTotalThread() {
-        return props.getInt("push.totalThread");
-    }
-
-    public void setTotalThread(int totalThread) {
-        props.setProperty("push.totalThread", totalThread);
-    }
-
-    public int getRecordPerPage() {
-        return props.getInt("push.recordPerPage");
-    }
-
-    public void setRecordPerPage(int recordPerPage) {
-        props.setProperty("push.recordPerPage", recordPerPage);
-    }
-
-    public int getPagePerThread() {
-        return props.getInt("push.pagePerThread");
-    }
-
-    public void setPagePerThread(int pagePerThread) {
-        props.setProperty("push.pagePerThread", pagePerThread);
+    public void setThreadCount(int threadCount) {
+        setting.put("push", "threadCount", String.valueOf(threadCount));
     }
 
     public boolean isDryRun() {
-        return props.getBool("push.dryRun");
+        return setting.getBool("dryRun", "push", true);
     }
 
     public void setDryRun(boolean dryRun) {
-        props.setProperty("push.dryRun", dryRun);
+        setting.put("push", "dryRun", String.valueOf(dryRun));
     }
 
     public boolean isRadioStartAt() {
-        return props.getBool("schedule.radioStartAt");
+        return setting.getBool("radioStartAt", "schedule", false);
     }
 
     public void setRadioStartAt(boolean radioStartAt) {
-        props.setProperty("schedule.radioStartAt", radioStartAt);
+        setting.put("schedule", "radioStartAt", String.valueOf(radioStartAt));
     }
 
     public String getTextStartAt() {
-        return props.getProperty("schedule.textStartAt");
+        return setting.getStr("textStartAt", "schedule", "");
     }
 
     public void setTextStartAt(String textStartAt) {
-        props.setProperty("schedule.textStartAt", textStartAt);
-    }
-
-    public boolean isRadioStopAt() {
-        return props.getBool("schedule.radioStopAt");
-    }
-
-    public void setRadioStopAt(boolean radioStopAt) {
-        props.setProperty("schedule.radioStopAt", radioStopAt);
-    }
-
-    public String getTextStopAt() {
-        return props.getProperty("schedule.textStopAt");
-    }
-
-    public void setTextStopAt(String textStopAt) {
-        props.setProperty("schedule.textStopAt", textStopAt);
+        setting.put("schedule", "textStartAt", textStartAt);
     }
 
     public boolean isRadioPerDay() {
-        return props.getBool("schedule.radioPerDay");
+        return setting.getBool("radioPerDay", "schedule", false);
     }
 
     public void setRadioPerDay(boolean radioPerDay) {
-        props.setProperty("schedule.radioPerDay", radioPerDay);
+        setting.put("schedule", "radioPerDay", String.valueOf(radioPerDay));
     }
 
     public String getTextPerDay() {
-        return props.getProperty("schedule.textPerDay");
+        return setting.getStr("textPerDay", "schedule", "");
     }
 
     public void setTextPerDay(String textPerDay) {
-        props.setProperty("schedule.textPerDay", textPerDay);
+        setting.put("schedule", "textPerDay", textPerDay);
     }
 
     public boolean isRadioPerWeek() {
-        return props.getBool("schedule.radioPerWeek");
+        return setting.getBool("radioPerWeek", "schedule", false);
     }
 
     public void setRadioPerWeek(boolean radioPerWeek) {
-        props.setProperty("schedule.radioPerWeek", radioPerWeek);
+        setting.put("schedule", "radioPerWeek", String.valueOf(radioPerWeek));
     }
 
     public String getTextPerWeekWeek() {
-        return props.getProperty("schedule.textPerWeek.week");
+        return setting.getStr("textPerWeek.week", "schedule", "一");
     }
 
     public void setTextPerWeekWeek(String textPerWeekWeek) {
-        props.setProperty("schedule.textPerWeek.week", textPerWeekWeek);
+        setting.put("schedule", "textPerWeek.week", textPerWeekWeek);
     }
 
     public String getTextPerWeekTime() {
-        return props.getProperty("schedule.textPerWeek.time");
+        return setting.getStr("textPerWeek.time", "schedule", "");
     }
 
     public void setTextPerWeekTime(String textPerWeekTime) {
-        props.setProperty("schedule.textPerWeek.time", textPerWeekTime);
+        setting.put("schedule", "textPerWeek.time", textPerWeekTime);
     }
 
     public boolean isAutoCheckUpdate() {
-        return props.getBool("setting.normal.autoCheckUpdate") == null ? true : props.getBool("setting.normal.autoCheckUpdate");
+        return setting.getBool("autoCheckUpdate", "setting.normal", true);
     }
 
     public void setAutoCheckUpdate(boolean autoCheckUpdate) {
-        props.setProperty("setting.normal.autoCheckUpdate", autoCheckUpdate);
+        setting.put("setting.normal", "autoCheckUpdate", String.valueOf(autoCheckUpdate));
     }
 
     public String getWechatAppId() {
-        return props.getProperty("setting.wechat.appId");
+        return setting.getStr("appId", "setting.wechat", "");
     }
 
     public void setWechatAppId(String wechatAppId) {
-        props.setProperty("setting.wechat.appId", wechatAppId);
+        setting.put("setting.wechat", "appId", wechatAppId);
     }
 
     public String getWechatAppSecret() {
-        return props.getProperty("setting.wechat.AppSecret");
+        return setting.getStr("AppSecret", "setting.wechat", "");
     }
 
     public void setWechatAppSecret(String wechatAppSecret) {
-        props.setProperty("setting.wechat.AppSecret", wechatAppSecret);
+        setting.put("setting.wechat", "AppSecret", wechatAppSecret);
     }
 
     public String getWechatToken() {
-        return props.getProperty("setting.wechat.token");
+        return setting.getStr("token", "setting.wechat", "");
     }
 
     public void setWechatToken(String wechatToken) {
-        props.setProperty("setting.wechat.token", wechatToken);
+        setting.put("setting.wechat", "token", wechatToken);
     }
 
     public String getWechatAesKey() {
-        return props.getProperty("setting.wechat.aesKey");
+        return setting.getStr("aesKey", "setting.wechat", "");
     }
 
     public void setWechatAesKey(String wechatAesKey) {
-        props.setProperty("setting.wechat.aesKey", wechatAesKey);
+        setting.put("setting.wechat", "aesKey", wechatAesKey);
     }
 
     public String getAliServerUrl() {
-        return props.getProperty("setting.ali.serverUrl");
+        return setting.getStr("serverUrl", "setting.ali", "");
     }
 
     public void setAliServerUrl(String aliServerUrl) {
-        props.setProperty("setting.ali.serverUrl", aliServerUrl);
+        setting.put("setting.ali", "serverUrl", aliServerUrl);
     }
 
     public String getAliAppKey() {
-        return props.getProperty("setting.ali.appKey");
+        return setting.getStr("appKey", "setting.ali", "");
     }
 
     public void setAliAppKey(String aliAppKey) {
-        props.setProperty("setting.ali.appKey", aliAppKey);
+        setting.put("setting.ali", "appKey", aliAppKey);
     }
 
     public String getAliAppSecret() {
-        return props.getProperty("setting.ali.appSecret");
+        return setting.getStr("appSecret", "setting.ali", "");
     }
 
     public void setAliAppSecret(String aliAppSecret) {
-        props.setProperty("setting.ali.appSecret", aliAppSecret);
+        setting.put("setting.ali", "appSecret", aliAppSecret);
     }
 
     public String getAliSign() {
-        return props.getProperty("setting.ali.sign");
+        return setting.getStr("sign", "setting.ali", "");
     }
 
     public void setAliSign(String aliSign) {
-        props.setProperty("setting.ali.sign", aliSign);
+        setting.put("setting.ali", "sign", aliSign);
     }
 
     public String getMysqlUrl() {
-        return props.getProperty("setting.mysql.url");
+        return setting.getStr("url", "setting.mysql", "");
     }
 
     public void setMysqlUrl(String mysqlUrl) {
-        props.setProperty("setting.mysql.url", mysqlUrl);
+        setting.put("setting.mysql", "url", mysqlUrl);
     }
 
     public String getMysqlDatabase() {
-        return props.getProperty("setting.mysql.database");
+        return setting.getStr("database", "setting.mysql", "");
     }
 
     public void setMysqlDatabase(String mysqlDatabase) {
-        props.setProperty("setting.mysql.database", mysqlDatabase);
+        setting.put("setting.mysql", "database", mysqlDatabase);
     }
 
     public String getMysqlUser() {
-        return props.getProperty("setting.mysql.user");
+        return setting.getStr("user", "setting.mysql", "");
     }
 
     public void setMysqlUser(String mysqlUser) {
-        props.setProperty("setting.mysql.user", mysqlUser);
+        setting.put("setting.mysql", "user", mysqlUser);
     }
 
     public String getMysqlPassword() {
-        return props.getProperty("setting.mysql.password");
+        return setting.getStr("password", "setting.mysql", "");
     }
 
     public void setMysqlPassword(String mysqlPassword) {
-        props.setProperty("setting.mysql.password", mysqlPassword);
+        setting.put("setting.mysql", "password", mysqlPassword);
     }
 
     public String getTheme() {
-        return props.getProperty("setting.appearance.theme");
+        return setting.getStr("theme", "setting.appearance", "Darcula(推荐)");
     }
 
     public void setTheme(String theme) {
-        props.setProperty("setting.appearance.theme", theme);
+        setting.put("setting.appearance", "theme", theme);
     }
 
     public String getFont() {
-        return props.getProperty("setting.appearance.font");
+        return setting.getStr("font", "setting.appearance", "Microsoft YaHei UI");
     }
 
     public void setFont(String font) {
-        props.setProperty("setting.appearance.font", font);
+        setting.put("setting.appearance", "font", font);
     }
 
     public int getFontSize() {
-        return props.getInt("setting.appearance.fontSize");
+        return setting.getInt("fontSize", "setting.appearance", 18);
     }
 
     public void setFontSize(int fontSize) {
-        props.setProperty("setting.appearance.fontSize", fontSize);
+        setting.put("setting.appearance", "fontSize", String.valueOf(fontSize));
     }
 
     public String getAliyunAccessKeyId() {
-        return props.getProperty("setting.aliyun.accessKeyId");
+        return setting.getStr("accessKeyId", "setting.aliyun", "");
     }
 
     public void setAliyunAccessKeyId(String aliyunAccessKeyId) {
-        props.setProperty("setting.aliyun.accessKeyId", aliyunAccessKeyId);
+        setting.put("setting.aliyun", "accessKeyId", aliyunAccessKeyId);
     }
 
     public String getAliyunAccessKeySecret() {
-        return props.getProperty("setting.aliyun.accessKeySecret");
+        return setting.getStr("accessKeySecret", "setting.aliyun", "");
     }
 
     public void setAliyunAccessKeySecret(String aliyunAccessKeySecret) {
-        props.setProperty("setting.aliyun.accessKeySecret", aliyunAccessKeySecret);
+        setting.put("setting.aliyun", "accessKeySecret", aliyunAccessKeySecret);
     }
 
     public String getAliyunSign() {
-        return props.getProperty("setting.aliyun.aliyunSign");
+        return setting.getStr("aliyunSign", "setting.aliyun", "");
     }
 
     public void setAliyunSign(String aliyunSign) {
-        props.setProperty("setting.aliyun.aliyunSign", aliyunSign);
+        setting.put("setting.aliyun", "aliyunSign", aliyunSign);
     }
 
     public String getMiniAppAppId() {
-        return props.getProperty("setting.miniApp.appId");
+        return setting.getStr("appId", "setting.miniApp", "");
     }
 
     public void setMiniAppAppId(String miniAppAppId) {
-        props.setProperty("setting.miniApp.appId", miniAppAppId);
+        setting.put("setting.miniApp", "appId", miniAppAppId);
     }
 
     public String getMiniAppAppSecret() {
-        return props.getProperty("setting.miniApp.AppSecret");
+        return setting.getStr("AppSecret", "setting.miniApp", "");
     }
 
     public void setMiniAppAppSecret(String miniAppAppSecret) {
-        props.setProperty("setting.miniApp.AppSecret", miniAppAppSecret);
+        setting.put("setting.miniApp", "AppSecret", miniAppAppSecret);
     }
 
     public String getMiniAppToken() {
-        return props.getProperty("setting.miniApp.token");
+        return setting.getStr("token", "setting.miniApp", "");
     }
 
     public void setMiniAppToken(String miniAppToken) {
-        props.setProperty("setting.miniApp.token", miniAppToken);
+        setting.put("setting.miniApp", "token", miniAppToken);
     }
 
     public String getMiniAppAesKey() {
-        return props.getProperty("setting.miniApp.aesKey");
+        return setting.getStr("aesKey", "setting.miniApp", "");
     }
 
     public void setMiniAppAesKey(String miniAppAesKey) {
-        props.setProperty("setting.miniApp.aesKey", miniAppAesKey);
+        setting.put("setting.miniApp", "aesKey", miniAppAesKey);
     }
 
     public String getTxyunAppId() {
-        return props.getProperty("setting.txyun.appId");
+        return setting.getStr("appId", "setting.txyun", "");
     }
 
     public void setTxyunAppId(String txyunAppId) {
-        props.setProperty("setting.txyun.appId", txyunAppId);
+        setting.put("setting.txyun", "appId", txyunAppId);
     }
 
     public String getTxyunAppKey() {
-        return props.getProperty("setting.txyun.appKey");
+        return setting.getStr("appKey", "setting.txyun", "");
     }
 
     public void setTxyunAppKey(String txyunAppKey) {
-        props.setProperty("setting.txyun.appKey", txyunAppKey);
+        setting.put("setting.txyun", "appKey", txyunAppKey);
     }
 
     public String getTxyunSign() {
-        return props.getProperty("setting.txyun.txyunSign");
+        return setting.getStr("txyunSign", "setting.txyun", "");
     }
 
     public void setTxyunSign(String txyunSign) {
-        props.setProperty("setting.txyun.txyunSign", txyunSign);
+        setting.put("setting.txyun", "txyunSign", txyunSign);
     }
 
     public String getYunpianApiKey() {
-        return props.getProperty("setting.yunpian.apiKey");
+        return setting.getStr("apiKey", "setting.yunpian", "");
     }
 
     public void setYunpianApiKey(String yunpianApiKey) {
-        props.setProperty("setting.yunpian.apiKey", yunpianApiKey);
+        setting.put("setting.yunpian", "apiKey", yunpianApiKey);
     }
 }
diff --git a/src/main/java/com/fangxuele/tool/push/util/DbUtilMySQL.java b/src/main/java/com/fangxuele/tool/push/util/DbUtilMySQL.java
index 542bac56..50d384b0 100644
--- a/src/main/java/com/fangxuele/tool/push/util/DbUtilMySQL.java
+++ b/src/main/java/com/fangxuele/tool/push/util/DbUtilMySQL.java
@@ -3,10 +3,7 @@
 import cn.hutool.log.Log;
 import cn.hutool.log.LogFactory;
 import com.fangxuele.tool.push.ui.Init;
-import com.fangxuele.tool.push.ui.form.MainWindow;
-import org.apache.commons.lang3.StringUtils;
 
-import javax.swing.*;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
@@ -60,18 +57,10 @@ public static synchronized DbUtilMySQL getInstance() {
     private void loadConfig() {
         try {
             String dbclassname = "com.mysql.cj.jdbc.Driver";
-            DBUrl = Init.configer.getMysqlUrl();
-            DBName = Init.configer.getMysqlDatabase();
-            DBUser = Init.configer.getMysqlUser();
-            DBPassword = Init.configer.getMysqlPassword();
-
-            if (StringUtils.isEmpty(DBUrl) || StringUtils.isEmpty(DBName)
-                    || StringUtils.isEmpty(DBUser) || StringUtils.isEmpty(DBPassword)) {
-                JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(),
-                        "请先在设置中填写并保存MySQL数据库相关配置!", "提示",
-                        JOptionPane.INFORMATION_MESSAGE);
-                return;
-            }
+            DBUrl = Init.config.getMysqlUrl();
+            DBName = Init.config.getMysqlDatabase();
+            DBUser = Init.config.getMysqlUser();
+            DBPassword = Init.config.getMysqlPassword();
 
             Class.forName(dbclassname);
         } catch (Exception e) {
@@ -88,12 +77,12 @@ private void loadConfig() {
      * @throws SQLException
      */
     private synchronized void getConnection() throws SQLException {
-        String user = Init.configer.getMysqlUser();
-        String password = Init.configer.getMysqlPassword();
+        String user = Init.config.getMysqlUser();
+        String password = Init.config.getMysqlPassword();
         // 当DB配置变更时重新获取
-        if (!Init.configer.getMysqlUrl().equals(DBUrl) || !Init.configer.getMysqlDatabase().equals(DBName)
-                || !Init.configer.getMysqlUser().equals(DBUser)
-                || !Init.configer.getMysqlPassword().equals(DBPassword)) {
+        if (!Init.config.getMysqlUrl().equals(DBUrl) || !Init.config.getMysqlDatabase().equals(DBName)
+                || !Init.config.getMysqlUser().equals(DBUser)
+                || !Init.config.getMysqlPassword().equals(DBPassword)) {
             loadConfig();
             // "jdbc:mysql://localhost/pxp2p_branch"
             connection = DriverManager.getConnection(
@@ -124,8 +113,8 @@ private synchronized void getConnection() throws SQLException {
      */
     public synchronized Connection testConnection() throws SQLException {
         loadConfig();
-        String user = Init.configer.getMysqlUser();
-        String password = Init.configer.getMysqlPassword();
+        String user = Init.config.getMysqlUser();
+        String password = Init.config.getMysqlPassword();
         connection = DriverManager.getConnection("jdbc:mysql://" + DBUrl + "/" + DBName, user, password);
         // 把事务提交方式改为手工提交
         connection.setAutoCommit(false);
diff --git a/src/main/java/com/fangxuele/tool/push/util/JTableUtil.java b/src/main/java/com/fangxuele/tool/push/util/JTableUtil.java
new file mode 100644
index 00000000..842bc1c2
--- /dev/null
+++ b/src/main/java/com/fangxuele/tool/push/util/JTableUtil.java
@@ -0,0 +1,45 @@
+package com.fangxuele.tool.push.util;
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableColumn;
+import java.awt.*;
+
+/**
+ * 
+ * JTableUtil
+ * 
+ * + * @author RememBerBer + * @since 2019/5/12. + */ +public class JTableUtil { + /** + * 隐藏表格中的某一列 + * + * @param table + * @param index + */ + public static void hideColumn(JTable table, int index) { + TableColumn tableColumn = table.getColumnModel().getColumn(index); + tableColumn.setMaxWidth(0); + tableColumn.setMinWidth(0); + tableColumn.setPreferredWidth(0); + tableColumn.setWidth(0); + + table.getTableHeader().getColumnModel().getColumn(index).setMaxWidth(0); + table.getTableHeader().getColumnModel().getColumn(index).setMinWidth(0); + } + + /** + * 隐藏表头 + * + * @param table + */ + public static void hideTableHeader(JTable table) { + table.getTableHeader().setVisible(false); + DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); + renderer.setPreferredSize(new Dimension(0, 0)); + table.getTableHeader().setDefaultRenderer(renderer); + } +} diff --git a/src/main/java/com/fangxuele/tool/push/util/MybatisUtil.java b/src/main/java/com/fangxuele/tool/push/util/MybatisUtil.java new file mode 100644 index 00000000..b640fc03 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/util/MybatisUtil.java @@ -0,0 +1,95 @@ +package com.fangxuele.tool.push.util; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.CharsetUtil; +import com.fangxuele.tool.push.ui.form.MainWindow; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; + +import java.io.File; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Properties; + +/** + *
+ * Mybatis工具
+ * 
+ * + * @author RememBerBer + * @since 2019/5/9. + */ +@Slf4j +public class MybatisUtil { + private static SqlSession sqlSession = null; + + /** + * 是否需要初始化 + */ + private static boolean needInit = false; + + private static File dbFile = new File(SystemUtil.configHome + "WePush.db"); + + static { + try { + initDbFile(); + + String resource = "mybatis-config.xml"; + InputStream inputStream = Resources.getResourceAsStream(resource); + Properties properties = new Properties(); + properties.setProperty("url", "jdbc:sqlite:" + dbFile.getAbsolutePath()); + SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream, properties); + sqlSession = sqlSessionFactory.openSession(true); + inputStream.close(); + + initTables(); + } catch (Exception e) { + log.error("get sqlSession error!", e); + } + } + + private MybatisUtil() { + + } + + public static SqlSession getSqlSession() { + return sqlSession; + } + + /** + * 初始化数据库文件 + */ + private static void initDbFile() throws SQLException { + if (!dbFile.exists()) { + File configHomeDir = new File(SystemUtil.configHome); + if (!configHomeDir.exists()) { + configHomeDir.mkdirs(); + } + // 不存在db文件时会自动创建一个 + Connection connection = DriverManager.getConnection("jdbc:sqlite:" + dbFile.getAbsolutePath()); + Statement stmt = connection.createStatement(); + String sql = FileUtil.readString(MainWindow.class.getResource("/db_init.sql"), CharsetUtil.UTF_8); + stmt.executeUpdate(sql); + stmt.close(); + connection.close(); + needInit = true; + } + } + + /** + * 初始化数据库表 + */ + private static void initTables() { + if (needInit) { + // doesn't work +// InitMapper initMapper = sqlSession.getMapper(InitMapper.class); +// initMapper.createAllTables(); + } + } +} diff --git a/src/main/java/com/fangxuele/tool/push/util/SqliteUtil.java b/src/main/java/com/fangxuele/tool/push/util/SqliteUtil.java new file mode 100644 index 00000000..95af21c2 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/push/util/SqliteUtil.java @@ -0,0 +1,20 @@ +package com.fangxuele.tool.push.util; + +import org.apache.commons.lang3.time.DateFormatUtils; + +import java.util.Date; + +/** + *
+ * Sqlite相关工具
+ * 
+ * + * @author Zhou Bo + * @since 2019/3/14. + */ +public class SqliteUtil { + + public static String nowDateForSqlite() { + return DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + } +} diff --git a/src/main/resources/db_init.sql b/src/main/resources/db_init.sql new file mode 100644 index 00000000..cdd526cc --- /dev/null +++ b/src/main/resources/db_init.sql @@ -0,0 +1,134 @@ +create table if not exists t_msg_kefu +( + id integer + constraint t_msg_kefu_pk + primary key autoincrement, + msg_type integer, + msg_name text, + kefu_msg_type text, + content text, + title text, + img_url text, + describe text, + url text, + create_time datetime, + modified_time datetime +); +create unique index if not exists t_msg_kefu_msg_type_msg_name_uindex + on t_msg_kefu (msg_type, msg_name); +create table if not exists t_msg_kefu_priority +( + id integer + constraint t_msg_kefu_priority_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + url text, + ma_appid text, + ma_page_path text, + kefu_msg_type text, + content text, + title text, + img_url text, + describe text, + kefu_url text, + create_time datetime, + modified_time datetime +); +create unique index if not exists t_msg_kefu_priority_msg_type_msg_name_uindex + on t_msg_kefu_priority (msg_type, msg_name); +create table if not exists t_msg_ma_template +( + id integer + constraint t_msg_ma_template_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + page text, + emphasis_keyword text, + create_time datetime, + modified_time datetime +); +create unique index if not exists t_msg_ma_template_msg_type_msg_name_uindex + on t_msg_ma_template (msg_type, msg_name); +create table if not exists t_msg_mp_template +( + id integer + constraint t_msg_mp_template_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + url text, + ma_appid text, + ma_page_path text, + create_time datetime, + modified_time datetime +); +create unique index if not exists t_msg_mp_template_msg_type_msg_name_uindex + on t_msg_mp_template (msg_type, msg_name); +create table if not exists t_msg_sms +( + id integer + constraint t_msg_ali_template_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + content text, + create_time datetime, + modified_time datetime +); +create unique index if not exists t_msg_sms_msg_type_msg_name_uindex + on t_msg_sms (msg_type, msg_name); +create table if not exists t_push_history +( + id integer + constraint t_push_history_pk + primary key autoincrement, + msg_id integer, + msg_type integer, + msg_name text, + result text, + csv_file text, + create_time datetime, + modified_time datetime +); +create table if not exists t_template_data +( + id integer + constraint t_template_data_ma_pk + primary key autoincrement, + msg_type integer, + msg_id integer, + name text, + value text, + color text, + create_time datetime, + modified_time datetime +); +create table t_wx_mp_user +( + open_id text + constraint t_wx_mp_user_pk + primary key, + nickname text, + sex_desc text, + sex INTEGER, + language text, + city text, + province text, + country text, + head_img_url text, + subscribe_time text, + union_id text, + remark text, + group_id integer, + subscribe_scene text, + qr_scene text, + qr_scene_str text, + create_time text, + modified_time text +); \ No newline at end of file diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml new file mode 100644 index 00000000..4a825007 --- /dev/null +++ b/src/main/resources/generatorConfig.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
\ No newline at end of file diff --git a/src/main/resources/icon/analyze.png b/src/main/resources/icon/analyze.png new file mode 100644 index 00000000..6dd48f2e Binary files /dev/null and b/src/main/resources/icon/analyze.png differ diff --git a/src/main/resources/icon/analyze@2x.png b/src/main/resources/icon/analyze@2x.png new file mode 100644 index 00000000..56129cee Binary files /dev/null and b/src/main/resources/icon/analyze@2x.png differ diff --git a/src/main/resources/icon/arrow_left.png b/src/main/resources/icon/arrow_left.png new file mode 100644 index 00000000..81a180fa Binary files /dev/null and b/src/main/resources/icon/arrow_left.png differ diff --git a/src/main/resources/icon/arrow_left@2x.png b/src/main/resources/icon/arrow_left@2x.png new file mode 100644 index 00000000..16d4e0ba Binary files /dev/null and b/src/main/resources/icon/arrow_left@2x.png differ diff --git a/src/main/resources/icon/arrow_right.png b/src/main/resources/icon/arrow_right.png new file mode 100644 index 00000000..7d487c22 Binary files /dev/null and b/src/main/resources/icon/arrow_right.png differ diff --git a/src/main/resources/icon/arrow_right@2x.png b/src/main/resources/icon/arrow_right@2x.png new file mode 100644 index 00000000..8fb650bd Binary files /dev/null and b/src/main/resources/icon/arrow_right@2x.png differ diff --git a/src/main/resources/icon/export.png b/src/main/resources/icon/export.png new file mode 100644 index 00000000..cad1c0a6 Binary files /dev/null and b/src/main/resources/icon/export.png differ diff --git a/src/main/resources/icon/export@2x.png b/src/main/resources/icon/export@2x.png new file mode 100644 index 00000000..8056080e Binary files /dev/null and b/src/main/resources/icon/export@2x.png differ diff --git a/src/main/resources/icon/export@2x_dark.png b/src/main/resources/icon/export@2x_dark.png new file mode 100644 index 00000000..086344ef Binary files /dev/null and b/src/main/resources/icon/export@2x_dark.png differ diff --git a/src/main/resources/icon/export_dark.png b/src/main/resources/icon/export_dark.png new file mode 100644 index 00000000..9f5bc76c Binary files /dev/null and b/src/main/resources/icon/export_dark.png differ diff --git a/src/main/resources/icon/favorite.png b/src/main/resources/icon/favorite.png new file mode 100644 index 00000000..54b64a5a Binary files /dev/null and b/src/main/resources/icon/favorite.png differ diff --git a/src/main/resources/icon/favorite@2x.png b/src/main/resources/icon/favorite@2x.png new file mode 100644 index 00000000..202cf573 Binary files /dev/null and b/src/main/resources/icon/favorite@2x.png differ diff --git a/src/main/resources/icon/feature.png b/src/main/resources/icon/feature.png new file mode 100644 index 00000000..26793add Binary files /dev/null and b/src/main/resources/icon/feature.png differ diff --git a/src/main/resources/icon/feature@2x.png b/src/main/resources/icon/feature@2x.png new file mode 100644 index 00000000..66f44bd2 Binary files /dev/null and b/src/main/resources/icon/feature@2x.png differ diff --git a/src/main/resources/icon/find.png b/src/main/resources/icon/find.png new file mode 100644 index 00000000..b5813008 Binary files /dev/null and b/src/main/resources/icon/find.png differ diff --git a/src/main/resources/icon/find@2x.png b/src/main/resources/icon/find@2x.png new file mode 100644 index 00000000..56977bfc Binary files /dev/null and b/src/main/resources/icon/find@2x.png differ diff --git a/src/main/resources/icon/find@2x_dark.png b/src/main/resources/icon/find@2x_dark.png new file mode 100644 index 00000000..d6de6c74 Binary files /dev/null and b/src/main/resources/icon/find@2x_dark.png differ diff --git a/src/main/resources/icon/findPlain.png b/src/main/resources/icon/findPlain.png new file mode 100644 index 00000000..8514cde0 Binary files /dev/null and b/src/main/resources/icon/findPlain.png differ diff --git a/src/main/resources/icon/findPlain@2x.png b/src/main/resources/icon/findPlain@2x.png new file mode 100644 index 00000000..93c1ed30 Binary files /dev/null and b/src/main/resources/icon/findPlain@2x.png differ diff --git a/src/main/resources/icon/findWhite.png b/src/main/resources/icon/findWhite.png new file mode 100644 index 00000000..b2a65f4f Binary files /dev/null and b/src/main/resources/icon/findWhite.png differ diff --git a/src/main/resources/icon/findWhite@2x.png b/src/main/resources/icon/findWhite@2x.png new file mode 100644 index 00000000..ecab5d67 Binary files /dev/null and b/src/main/resources/icon/findWhite@2x.png differ diff --git a/src/main/resources/icon/find_dark.png b/src/main/resources/icon/find_dark.png new file mode 100644 index 00000000..d8800125 Binary files /dev/null and b/src/main/resources/icon/find_dark.png differ diff --git a/src/main/resources/icon/import.png b/src/main/resources/icon/import.png new file mode 100644 index 00000000..68940509 Binary files /dev/null and b/src/main/resources/icon/import.png differ diff --git a/src/main/resources/icon/import@2x.png b/src/main/resources/icon/import@2x.png new file mode 100644 index 00000000..34157513 Binary files /dev/null and b/src/main/resources/icon/import@2x.png differ diff --git a/src/main/resources/icon/import@2x_dark.png b/src/main/resources/icon/import@2x_dark.png new file mode 100644 index 00000000..3f7d51a3 Binary files /dev/null and b/src/main/resources/icon/import@2x_dark.png differ diff --git a/src/main/resources/icon/import_dark.png b/src/main/resources/icon/import_dark.png new file mode 100644 index 00000000..f93321e3 Binary files /dev/null and b/src/main/resources/icon/import_dark.png differ diff --git a/src/main/resources/icon/menu-saveall.png b/src/main/resources/icon/menu-saveall.png new file mode 100644 index 00000000..44803f96 Binary files /dev/null and b/src/main/resources/icon/menu-saveall.png differ diff --git a/src/main/resources/icon/menu-saveall@2x.png b/src/main/resources/icon/menu-saveall@2x.png new file mode 100644 index 00000000..ce38ac2f Binary files /dev/null and b/src/main/resources/icon/menu-saveall@2x.png differ diff --git a/src/main/resources/icon/menu-saveall@2x_dark.png b/src/main/resources/icon/menu-saveall@2x_dark.png new file mode 100644 index 00000000..93859efd Binary files /dev/null and b/src/main/resources/icon/menu-saveall@2x_dark.png differ diff --git a/src/main/resources/icon/menu-saveall_dark.png b/src/main/resources/icon/menu-saveall_dark.png new file mode 100644 index 00000000..5e3b4953 Binary files /dev/null and b/src/main/resources/icon/menu-saveall_dark.png differ diff --git a/src/main/resources/icon/preview.png b/src/main/resources/icon/preview.png new file mode 100644 index 00000000..b7e56f16 Binary files /dev/null and b/src/main/resources/icon/preview.png differ diff --git a/src/main/resources/icon/preview@2x.png b/src/main/resources/icon/preview@2x.png new file mode 100644 index 00000000..8d1b895e Binary files /dev/null and b/src/main/resources/icon/preview@2x.png differ diff --git a/src/main/resources/icon/preview@2x_dark.png b/src/main/resources/icon/preview@2x_dark.png new file mode 100644 index 00000000..520f66d5 Binary files /dev/null and b/src/main/resources/icon/preview@2x_dark.png differ diff --git a/src/main/resources/icon/preview_dark.png b/src/main/resources/icon/preview_dark.png new file mode 100644 index 00000000..ce245c58 Binary files /dev/null and b/src/main/resources/icon/preview_dark.png differ diff --git a/src/main/resources/icon/remove.png b/src/main/resources/icon/remove.png index 6a0c24ca..c6ff278b 100644 Binary files a/src/main/resources/icon/remove.png and b/src/main/resources/icon/remove.png differ diff --git a/src/main/resources/icon/remove@2x.png b/src/main/resources/icon/remove@2x.png index bc114f52..fcfb1bd2 100644 Binary files a/src/main/resources/icon/remove@2x.png and b/src/main/resources/icon/remove@2x.png differ diff --git a/src/main/resources/icon/remove@2x_dark.png b/src/main/resources/icon/remove@2x_dark.png new file mode 100644 index 00000000..2a7d75cb Binary files /dev/null and b/src/main/resources/icon/remove@2x_dark.png differ diff --git a/src/main/resources/icon/remove_dark.png b/src/main/resources/icon/remove_dark.png new file mode 100644 index 00000000..3c039bb8 Binary files /dev/null and b/src/main/resources/icon/remove_dark.png differ diff --git a/src/main/resources/icon/saveTempConfig.png b/src/main/resources/icon/saveTempConfig.png new file mode 100644 index 00000000..40edbf15 Binary files /dev/null and b/src/main/resources/icon/saveTempConfig.png differ diff --git a/src/main/resources/icon/saveTempConfig@2x.png b/src/main/resources/icon/saveTempConfig@2x.png new file mode 100644 index 00000000..966cadf8 Binary files /dev/null and b/src/main/resources/icon/saveTempConfig@2x.png differ diff --git a/src/main/resources/icon/selectall.png b/src/main/resources/icon/selectall.png new file mode 100644 index 00000000..07bf5183 Binary files /dev/null and b/src/main/resources/icon/selectall.png differ diff --git a/src/main/resources/icon/selectall@2x.png b/src/main/resources/icon/selectall@2x.png new file mode 100644 index 00000000..0a63d1b3 Binary files /dev/null and b/src/main/resources/icon/selectall@2x.png differ diff --git a/src/main/resources/icon/selectall@2x_dark.png b/src/main/resources/icon/selectall@2x_dark.png new file mode 100644 index 00000000..969063a5 Binary files /dev/null and b/src/main/resources/icon/selectall@2x_dark.png differ diff --git a/src/main/resources/icon/selectall_dark.png b/src/main/resources/icon/selectall_dark.png new file mode 100644 index 00000000..5a04e032 Binary files /dev/null and b/src/main/resources/icon/selectall_dark.png differ diff --git a/src/main/resources/mapper/InitMapper.xml b/src/main/resources/mapper/InitMapper.xml new file mode 100644 index 00000000..b1fbd4f8 --- /dev/null +++ b/src/main/resources/mapper/InitMapper.xml @@ -0,0 +1,116 @@ + + + + + create table t_msg_kefu + ( + id integer + constraint t_msg_kefu_pk + primary key autoincrement, + msg_type integer, + msg_name text, + kefu_msg_type text, + content text, + title text, + img_url text, + describe text, + url text, + create_time datetime, + modified_time datetime + ); + create unique index t_msg_kefu_msg_type_msg_name_uindex + on t_msg_kefu (msg_type, msg_name); + create table t_msg_kefu_priority + ( + id integer + constraint t_msg_kefu_priority_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + url text, + ma_appid text, + ma_page_path text, + kefu_msg_type text, + content text, + title text, + img_url text, + describe text, + kefu_url text, + create_time datetime, + modified_time datetime + ); + create unique index t_msg_kefu_priority_msg_type_msg_name_uindex + on t_msg_kefu_priority (msg_type, msg_name); + create table t_msg_ma_template + ( + id integer + constraint t_msg_ma_template_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + page text, + emphasis_keyword text, + create_time datetime, + modified_time datetime + ); + create unique index t_msg_ma_template_msg_type_msg_name_uindex + on t_msg_ma_template (msg_type, msg_name); + create table t_msg_mp_template + ( + id integer + constraint t_msg_mp_template_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + url text, + ma_appid text, + ma_page_path text, + create_time datetime, + modified_time datetime + ); + create unique index t_msg_mp_template_msg_type_msg_name_uindex + on t_msg_mp_template (msg_type, msg_name); + create table t_msg_sms + ( + id integer + constraint t_msg_ali_template_pk + primary key autoincrement, + msg_type integer, + msg_name text, + template_id text, + content text, + create_time datetime, + modified_time datetime + ); + create unique index t_msg_sms_msg_type_msg_name_uindex + on t_msg_sms (msg_type, msg_name); + create table t_push_history + ( + id integer + constraint t_push_history_pk + primary key autoincrement, + msg_id integer, + msg_type integer, + msg_name text, + result text, + csv_file text, + create_time datetime, + modified_time datetime + ); + create table t_template_data + ( + id integer + constraint t_template_data_ma_pk + primary key autoincrement, + msg_id integer, + name text, + value text, + color text, + create_time datetime, + modified_time datetime + ); + + \ No newline at end of file diff --git a/src/main/resources/mapper/TMsgKefuMapper.xml b/src/main/resources/mapper/TMsgKefuMapper.xml new file mode 100644 index 00000000..c1e1cdb2 --- /dev/null +++ b/src/main/resources/mapper/TMsgKefuMapper.xml @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + id, msg_type, msg_name, kefu_msg_type, content, title, img_url, describe, url, create_time, + modified_time + + + + delete + from t_msg_kefu + where id = #{id,jdbcType=INTEGER} + + + insert into t_msg_kefu (id, msg_type, msg_name, + kefu_msg_type, content, title, + img_url, describe, url, + create_time, modified_time) + values (#{id,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, #{msgName,jdbcType=VARCHAR}, + #{kefuMsgType,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, + #{imgUrl,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, + #{createTime,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_msg_kefu + + + id, + + + msg_type, + + + msg_name, + + + kefu_msg_type, + + + content, + + + title, + + + img_url, + + + describe, + + + url, + + + create_time, + + + modified_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{msgType,jdbcType=INTEGER}, + + + #{msgName,jdbcType=VARCHAR}, + + + #{kefuMsgType,jdbcType=VARCHAR}, + + + #{content,jdbcType=VARCHAR}, + + + #{title,jdbcType=VARCHAR}, + + + #{imgUrl,jdbcType=VARCHAR}, + + + #{describe,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_msg_kefu + + + msg_type = #{msgType,jdbcType=INTEGER}, + + + msg_name = #{msgName,jdbcType=VARCHAR}, + + + kefu_msg_type = #{kefuMsgType,jdbcType=VARCHAR}, + + + content = #{content,jdbcType=VARCHAR}, + + + title = #{title,jdbcType=VARCHAR}, + + + img_url = #{imgUrl,jdbcType=VARCHAR}, + + + describe = #{describe,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update t_msg_kefu + set msg_type = #{msgType,jdbcType=INTEGER}, + msg_name = #{msgName,jdbcType=VARCHAR}, + kefu_msg_type = #{kefuMsgType,jdbcType=VARCHAR}, + content = #{content,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + img_url = #{imgUrl,jdbcType=VARCHAR}, + describe = #{describe,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + update t_msg_kefu + set kefu_msg_type = #{kefuMsgType,jdbcType=VARCHAR}, + content = #{content,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + img_url = #{imgUrl,jdbcType=VARCHAR}, + describe = #{describe,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + + + delete + from t_msg_kefu + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TMsgKefuPriorityMapper.xml b/src/main/resources/mapper/TMsgKefuPriorityMapper.xml new file mode 100644 index 00000000..0a44f96b --- /dev/null +++ b/src/main/resources/mapper/TMsgKefuPriorityMapper.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + id, msg_type, msg_name, template_id, url, ma_appid, ma_page_path, kefu_msg_type, + content, title, img_url, describe, kefu_url, create_time, modified_time + + + + delete + from t_msg_kefu_priority + where id = #{id,jdbcType=INTEGER} + + + insert into t_msg_kefu_priority (id, msg_type, msg_name, + template_id, url, ma_appid, + ma_page_path, kefu_msg_type, content, + title, img_url, describe, + kefu_url, create_time, modified_time) + values (#{id,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, #{msgName,jdbcType=VARCHAR}, + #{templateId,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{maAppid,jdbcType=VARCHAR}, + #{maPagePath,jdbcType=VARCHAR}, #{kefuMsgType,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, + #{title,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, + #{kefuUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_msg_kefu_priority + + + id, + + + msg_type, + + + msg_name, + + + template_id, + + + url, + + + ma_appid, + + + ma_page_path, + + + kefu_msg_type, + + + content, + + + title, + + + img_url, + + + describe, + + + kefu_url, + + + create_time, + + + modified_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{msgType,jdbcType=INTEGER}, + + + #{msgName,jdbcType=VARCHAR}, + + + #{templateId,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{maAppid,jdbcType=VARCHAR}, + + + #{maPagePath,jdbcType=VARCHAR}, + + + #{kefuMsgType,jdbcType=VARCHAR}, + + + #{content,jdbcType=VARCHAR}, + + + #{title,jdbcType=VARCHAR}, + + + #{imgUrl,jdbcType=VARCHAR}, + + + #{describe,jdbcType=VARCHAR}, + + + #{kefuUrl,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_msg_kefu_priority + + + msg_type = #{msgType,jdbcType=INTEGER}, + + + msg_name = #{msgName,jdbcType=VARCHAR}, + + + template_id = #{templateId,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + ma_appid = #{maAppid,jdbcType=VARCHAR}, + + + ma_page_path = #{maPagePath,jdbcType=VARCHAR}, + + + kefu_msg_type = #{kefuMsgType,jdbcType=VARCHAR}, + + + content = #{content,jdbcType=VARCHAR}, + + + title = #{title,jdbcType=VARCHAR}, + + + img_url = #{imgUrl,jdbcType=VARCHAR}, + + + describe = #{describe,jdbcType=VARCHAR}, + + + kefu_url = #{kefuUrl,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update t_msg_kefu_priority + set msg_type = #{msgType,jdbcType=INTEGER}, + msg_name = #{msgName,jdbcType=VARCHAR}, + template_id = #{templateId,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + ma_appid = #{maAppid,jdbcType=VARCHAR}, + ma_page_path = #{maPagePath,jdbcType=VARCHAR}, + kefu_msg_type = #{kefuMsgType,jdbcType=VARCHAR}, + content = #{content,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + img_url = #{imgUrl,jdbcType=VARCHAR}, + describe = #{describe,jdbcType=VARCHAR}, + kefu_url = #{kefuUrl,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + update t_msg_kefu_priority + set template_id = #{templateId,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + ma_appid = #{maAppid,jdbcType=VARCHAR}, + ma_page_path = #{maPagePath,jdbcType=VARCHAR}, + kefu_msg_type = #{kefuMsgType,jdbcType=VARCHAR}, + content = #{content,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + img_url = #{imgUrl,jdbcType=VARCHAR}, + describe = #{describe,jdbcType=VARCHAR}, + kefu_url = #{kefuUrl,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + + + delete + from t_msg_kefu_priority + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TMsgMaTemplateMapper.xml b/src/main/resources/mapper/TMsgMaTemplateMapper.xml new file mode 100644 index 00000000..7fd21a00 --- /dev/null +++ b/src/main/resources/mapper/TMsgMaTemplateMapper.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + id, msg_type, msg_name, template_id, page, emphasis_keyword, create_time, modified_time + + + + delete + from t_msg_ma_template + where id = #{id,jdbcType=INTEGER} + + + insert into t_msg_ma_template (id, msg_type, msg_name, + template_id, page, emphasis_keyword, + create_time, modified_time) + values (#{id,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, #{msgName,jdbcType=VARCHAR}, + #{templateId,jdbcType=VARCHAR}, #{page,jdbcType=VARCHAR}, #{emphasisKeyword,jdbcType=VARCHAR}, + #{createTime,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_msg_ma_template + + + id, + + + msg_type, + + + msg_name, + + + template_id, + + + page, + + + emphasis_keyword, + + + create_time, + + + modified_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{msgType,jdbcType=INTEGER}, + + + #{msgName,jdbcType=VARCHAR}, + + + #{templateId,jdbcType=VARCHAR}, + + + #{page,jdbcType=VARCHAR}, + + + #{emphasisKeyword,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_msg_ma_template + + + msg_type = #{msgType,jdbcType=INTEGER}, + + + msg_name = #{msgName,jdbcType=VARCHAR}, + + + template_id = #{templateId,jdbcType=VARCHAR}, + + + page = #{page,jdbcType=VARCHAR}, + + + emphasis_keyword = #{emphasisKeyword,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update t_msg_ma_template + set msg_type = #{msgType,jdbcType=INTEGER}, + msg_name = #{msgName,jdbcType=VARCHAR}, + template_id = #{templateId,jdbcType=VARCHAR}, + page = #{page,jdbcType=VARCHAR}, + emphasis_keyword = #{emphasisKeyword,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + update t_msg_ma_template + set template_id = #{templateId,jdbcType=VARCHAR}, + page = #{page,jdbcType=VARCHAR}, + emphasis_keyword = #{emphasisKeyword,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + + + delete + from t_msg_ma_template + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TMsgMpTemplateMapper.xml b/src/main/resources/mapper/TMsgMpTemplateMapper.xml new file mode 100644 index 00000000..faebc8a2 --- /dev/null +++ b/src/main/resources/mapper/TMsgMpTemplateMapper.xml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + id, msg_type, msg_name, template_id, url, ma_appid, ma_page_path, create_time, modified_time + + + + delete + from t_msg_mp_template + where id = #{id,jdbcType=INTEGER} + + + insert into t_msg_mp_template (id, msg_type, msg_name, + template_id, url, ma_appid, + ma_page_path, create_time, modified_time) + values (#{id,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, #{msgName,jdbcType=VARCHAR}, + #{templateId,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{maAppid,jdbcType=VARCHAR}, + #{maPagePath,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_msg_mp_template + + + id, + + + msg_type, + + + msg_name, + + + template_id, + + + url, + + + ma_appid, + + + ma_page_path, + + + create_time, + + + modified_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{msgType,jdbcType=INTEGER}, + + + #{msgName,jdbcType=VARCHAR}, + + + #{templateId,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{maAppid,jdbcType=VARCHAR}, + + + #{maPagePath,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_msg_mp_template + + + msg_type = #{msgType,jdbcType=INTEGER}, + + + msg_name = #{msgName,jdbcType=VARCHAR}, + + + template_id = #{templateId,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + ma_appid = #{maAppid,jdbcType=VARCHAR}, + + + ma_page_path = #{maPagePath,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update t_msg_mp_template + set msg_type = #{msgType,jdbcType=INTEGER}, + msg_name = #{msgName,jdbcType=VARCHAR}, + template_id = #{templateId,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + ma_appid = #{maAppid,jdbcType=VARCHAR}, + ma_page_path = #{maPagePath,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + update t_msg_mp_template + set template_id = #{templateId,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + ma_appid = #{maAppid,jdbcType=VARCHAR}, + ma_page_path = #{maPagePath,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + + + delete + from t_msg_mp_template + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TMsgSmsMapper.xml b/src/main/resources/mapper/TMsgSmsMapper.xml new file mode 100644 index 00000000..033353d8 --- /dev/null +++ b/src/main/resources/mapper/TMsgSmsMapper.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + id, msg_type, msg_name, template_id, content, create_time, modified_time + + + + delete + from t_msg_sms + where id = #{id,jdbcType=INTEGER} + + + insert into t_msg_sms (id, msg_type, msg_name, + template_id, content, create_time, + modified_time) + values (#{id,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, #{msgName,jdbcType=VARCHAR}, + #{templateId,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, + #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_msg_sms + + + id, + + + msg_type, + + + msg_name, + + + template_id, + + + content, + + + create_time, + + + modified_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{msgType,jdbcType=INTEGER}, + + + #{msgName,jdbcType=VARCHAR}, + + + #{templateId,jdbcType=VARCHAR}, + + + #{content,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_msg_sms + + + msg_type = #{msgType,jdbcType=INTEGER}, + + + msg_name = #{msgName,jdbcType=VARCHAR}, + + + template_id = #{templateId,jdbcType=VARCHAR}, + + + content = #{content,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update t_msg_sms + set msg_type = #{msgType,jdbcType=INTEGER}, + msg_name = #{msgName,jdbcType=VARCHAR}, + template_id = #{templateId,jdbcType=VARCHAR}, + content = #{content,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + update t_msg_sms + set template_id = #{templateId,jdbcType=VARCHAR}, + content = #{content,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + + + delete + from t_msg_sms + where msg_type = #{msgType,jdbcType=INTEGER} + and msg_name = #{msgName,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TPushHistoryMapper.xml b/src/main/resources/mapper/TPushHistoryMapper.xml new file mode 100644 index 00000000..76fe37b4 --- /dev/null +++ b/src/main/resources/mapper/TPushHistoryMapper.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + id, msg_id, msg_type, msg_name, result, csv_file, create_time, modified_time + + + + delete + from t_push_history + where id = #{id,jdbcType=INTEGER} + + + insert into t_push_history (id, msg_id, msg_type, + msg_name, result, csv_file, + create_time, modified_time) + values (#{id,jdbcType=INTEGER}, #{msgId,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, + #{msgName,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{csvFile,jdbcType=VARCHAR}, + #{createTime,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_push_history + + + id, + + + msg_id, + + + msg_type, + + + msg_name, + + + result, + + + csv_file, + + + create_time, + + + modified_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{msgId,jdbcType=INTEGER}, + + + #{msgType,jdbcType=INTEGER}, + + + #{msgName,jdbcType=VARCHAR}, + + + #{result,jdbcType=VARCHAR}, + + + #{csvFile,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_push_history + + + msg_id = #{msgId,jdbcType=INTEGER}, + + + msg_type = #{msgType,jdbcType=INTEGER}, + + + msg_name = #{msgName,jdbcType=VARCHAR}, + + + result = #{result,jdbcType=VARCHAR}, + + + csv_file = #{csvFile,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update t_push_history + set msg_id = #{msgId,jdbcType=INTEGER}, + msg_type = #{msgType,jdbcType=INTEGER}, + msg_name = #{msgName,jdbcType=VARCHAR}, + result = #{result,jdbcType=VARCHAR}, + csv_file = #{csvFile,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TTemplateDataMapper.xml b/src/main/resources/mapper/TTemplateDataMapper.xml new file mode 100644 index 00000000..aee58efd --- /dev/null +++ b/src/main/resources/mapper/TTemplateDataMapper.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + id, msg_type, msg_id, name, value, color, create_time, modified_time + + + + delete + from t_template_data + where id = #{id,jdbcType=INTEGER} + + + insert into t_template_data (id, msg_type, msg_id, + name, value, color, + create_time, modified_time) + values (#{id,jdbcType=INTEGER}, #{msgType,jdbcType=INTEGER}, #{msgId,jdbcType=INTEGER}, + #{name,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, + #{createTime,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_template_data + + + id, + + + msg_type, + + + msg_id, + + + name, + + + value, + + + color, + + + create_time, + + + modified_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{msgType,jdbcType=INTEGER}, + + + #{msgId,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{color,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_template_data + + + msg_type = #{msgType,jdbcType=INTEGER}, + + + msg_id = #{msgId,jdbcType=INTEGER}, + + + name = #{name,jdbcType=VARCHAR}, + + + value = #{value,jdbcType=VARCHAR}, + + + color = #{color,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update t_template_data + set msg_type = #{msgType,jdbcType=INTEGER}, + msg_id = #{msgId,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR}, + value = #{value,jdbcType=VARCHAR}, + color = #{color,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + delete + from t_template_data + where msg_id = #{msgId,jdbcType=INTEGER} + and msg_type = #{msgType,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TWxMpUserMapper.xml b/src/main/resources/mapper/TWxMpUserMapper.xml new file mode 100644 index 00000000..8d2a36b5 --- /dev/null +++ b/src/main/resources/mapper/TWxMpUserMapper.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + open_id, nickname, sex_desc, sex, language, city, province, country, head_img_url, + subscribe_time, union_id, remark, group_id, subscribe_scene, qr_scene, qr_scene_str, + create_time, modified_time + + + + delete + from t_wx_mp_user + where open_id = #{openId,jdbcType=VARCHAR} + + + insert into t_wx_mp_user (open_id, nickname, sex_desc, + sex, language, city, + province, country, head_img_url, + subscribe_time, union_id, remark, + group_id, subscribe_scene, qr_scene, + qr_scene_str, create_time, modified_time) + values (#{openId,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, #{sexDesc,jdbcType=VARCHAR}, + #{sex,jdbcType=INTEGER}, #{language,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, + #{province,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{headImgUrl,jdbcType=VARCHAR}, + #{subscribeTime,jdbcType=VARCHAR}, #{unionId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{groupId,jdbcType=INTEGER}, #{subscribeScene,jdbcType=VARCHAR}, #{qrScene,jdbcType=VARCHAR}, + #{qrSceneStr,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=VARCHAR}) + + + insert into t_wx_mp_user + + + open_id, + + + nickname, + + + sex_desc, + + + sex, + + + language, + + + city, + + + province, + + + country, + + + head_img_url, + + + subscribe_time, + + + union_id, + + + remark, + + + group_id, + + + subscribe_scene, + + + qr_scene, + + + qr_scene_str, + + + create_time, + + + modified_time, + + + + + #{openId,jdbcType=VARCHAR}, + + + #{nickname,jdbcType=VARCHAR}, + + + #{sexDesc,jdbcType=VARCHAR}, + + + #{sex,jdbcType=INTEGER}, + + + #{language,jdbcType=VARCHAR}, + + + #{city,jdbcType=VARCHAR}, + + + #{province,jdbcType=VARCHAR}, + + + #{country,jdbcType=VARCHAR}, + + + #{headImgUrl,jdbcType=VARCHAR}, + + + #{subscribeTime,jdbcType=VARCHAR}, + + + #{unionId,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{groupId,jdbcType=INTEGER}, + + + #{subscribeScene,jdbcType=VARCHAR}, + + + #{qrScene,jdbcType=VARCHAR}, + + + #{qrSceneStr,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=VARCHAR}, + + + #{modifiedTime,jdbcType=VARCHAR}, + + + + + update t_wx_mp_user + + + nickname = #{nickname,jdbcType=VARCHAR}, + + + sex_desc = #{sexDesc,jdbcType=VARCHAR}, + + + sex = #{sex,jdbcType=INTEGER}, + + + language = #{language,jdbcType=VARCHAR}, + + + city = #{city,jdbcType=VARCHAR}, + + + province = #{province,jdbcType=VARCHAR}, + + + country = #{country,jdbcType=VARCHAR}, + + + head_img_url = #{headImgUrl,jdbcType=VARCHAR}, + + + subscribe_time = #{subscribeTime,jdbcType=VARCHAR}, + + + union_id = #{unionId,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + group_id = #{groupId,jdbcType=INTEGER}, + + + subscribe_scene = #{subscribeScene,jdbcType=VARCHAR}, + + + qr_scene = #{qrScene,jdbcType=VARCHAR}, + + + qr_scene_str = #{qrSceneStr,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=VARCHAR}, + + + modified_time = #{modifiedTime,jdbcType=VARCHAR}, + + + where open_id = #{openId,jdbcType=VARCHAR} + + + update t_wx_mp_user + set nickname = #{nickname,jdbcType=VARCHAR}, + sex_desc = #{sexDesc,jdbcType=VARCHAR}, + sex = #{sex,jdbcType=INTEGER}, + language = #{language,jdbcType=VARCHAR}, + city = #{city,jdbcType=VARCHAR}, + province = #{province,jdbcType=VARCHAR}, + country = #{country,jdbcType=VARCHAR}, + head_img_url = #{headImgUrl,jdbcType=VARCHAR}, + subscribe_time = #{subscribeTime,jdbcType=VARCHAR}, + union_id = #{unionId,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + group_id = #{groupId,jdbcType=INTEGER}, + subscribe_scene = #{subscribeScene,jdbcType=VARCHAR}, + qr_scene = #{qrScene,jdbcType=VARCHAR}, + qr_scene_str = #{qrSceneStr,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=VARCHAR}, + modified_time = #{modifiedTime,jdbcType=VARCHAR} + where open_id = #{openId,jdbcType=VARCHAR} + + + delete + from t_wx_mp_user + + \ No newline at end of file diff --git a/src/main/resources/mybatis-config.xml b/src/main/resources/mybatis-config.xml new file mode 100644 index 00000000..7523346f --- /dev/null +++ b/src/main/resources/mybatis-config.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/version_summary.json b/src/main/resources/version_summary.json index df075861..9b125ef9 100644 --- a/src/main/resources/version_summary.json +++ b/src/main/resources/version_summary.json @@ -1,5 +1,5 @@ { - "currentVersion": "v_2.3.3_190107", + "currentVersion": "v_3.0.0_190516", "versionIndex": { "v_1.1.0_170701": "0", "v_1.2.0_170831": "1", @@ -20,7 +20,8 @@ "v_2.3.0_180714": "16", "v_2.3.1_180721": "17", "v_2.3.2_181227": "18", - "v_2.3.3_190107": "19" + "v_2.3.3_190107": "19", + "v_3.0.0_190516": "20" }, "versionDetailList": [ { @@ -122,6 +123,11 @@ "version": "v_2.3.3_190107", "title": "使用模板引擎处理变量消息", "log": "1.使用Velocity模板引擎处理变量消息\n2.微信相关消息全局支持昵称变量:“${NICK_NAME}”\n3.所有消息全局支持换行变量:“${ENTER}”\n" + }, + { + "version": "v_3.0.0_190516", + "title": "3.0.0多项改进新鲜出炉!", + "log": "1.调整启动时UI加载策略,Windows平台增加启动器,提高启动速度\n2.全局设置文件由property改为setting(感谢HuTool)\n3.数据存储由文件调整为sqlite数据库\n4.新增支持直接滑动设置线程数\n5.消息类型解耦,为以后支持更多类型以及类型插件化做准备\n6.版本更新时支持直接下载立即安装\n7.大规模代码重构,bug修复\n8.大规模UI打磨优化\n9.微信用户数据导入优化\n10.由于底层数据存储方式变更较大,3.0.0版本及以后不再兼容老版本的数\n……\n" } ] } \ No newline at end of file