diff --git a/pom.xml b/pom.xml index b57e1ee1..158f7b8a 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,9 @@ 1.5.6 3.5.0 3.17 + 1.4 + 1.0.2 + 1.2.7 @@ -103,7 +106,19 @@ com.apple AppleJavaExtensions - 1.4 + ${AppleJavaExtensions.version} + + + + com.github.qcloudsms + qcloudsms + ${qcloudsms.version} + + + + com.yunpian.sdk + yunpian-java-sdk + ${yunpian-java-sdk.version} @@ -135,13 +150,6 @@ aliyun-java-sdk-dysmsapi 1.0.0 - - - com.github.qcloudsms - qcloudsms - 1.0.2 - - diff --git a/src/main/java/com/fangxuele/tool/wechat/push/logic/MsgHisManage.java b/src/main/java/com/fangxuele/tool/wechat/push/logic/MsgHisManage.java index c70aa424..c232ba1b 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/logic/MsgHisManage.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/logic/MsgHisManage.java @@ -33,7 +33,7 @@ public class MsgHisManage { /** * 历史消息保存的csv的列数 */ - public static final int ARRAY_LENGTH = 14; + public static final int ARRAY_LENGTH = 15; public static MsgHisManage getInstance() { return ourInstance; diff --git a/src/main/java/com/fangxuele/tool/wechat/push/logic/PushManage.java b/src/main/java/com/fangxuele/tool/wechat/push/logic/PushManage.java index a50692d2..5a0ae3b8 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/logic/PushManage.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/logic/PushManage.java @@ -26,6 +26,9 @@ import com.taobao.api.TaobaoClient; import com.taobao.api.request.AlibabaAliqinFcSmsNumSendRequest; import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse; +import com.yunpian.sdk.YunpianClient; +import com.yunpian.sdk.model.Result; +import com.yunpian.sdk.model.SmsSingleSend; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpConfigStorage; import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; @@ -61,7 +64,7 @@ public class PushManage { * * @throws Exception */ - public static void preview() throws Exception { + public static boolean preview() throws Exception { List msgDataList = new ArrayList<>(); for (String data : MainWindow.mainWindow.getPreviewUserField().getText().split(";")) { @@ -73,7 +76,7 @@ public static void preview() throws Exception { WxMpTemplateMessage wxMessageTemplate; WxMpService wxMpService = getWxMpService(); if (wxMpService.getWxMpConfigStorage() == null) { - return; + return false; } for (String[] msgData : msgDataList) { @@ -87,7 +90,7 @@ public static void preview() throws Exception { WxMaTemplateMessage wxMaMessageTemplate; WxMaService wxMaService = getWxMaService(); if (wxMaService.getWxMaConfig() == null) { - return; + return false; } for (String[] msgData : msgDataList) { @@ -102,7 +105,7 @@ public static void preview() throws Exception { wxMpService = getWxMpService(); WxMpKefuMessage wxMpKefuMessage; if (wxMpService.getWxMpConfigStorage() == null) { - return; + return false; } for (String[] msgData : msgDataList) { @@ -115,7 +118,7 @@ public static void preview() throws Exception { case "客服消息优先": wxMpService = getWxMpService(); if (wxMpService.getWxMpConfigStorage() == null) { - return; + return false; } for (String[] msgData : msgDataList) { @@ -140,6 +143,7 @@ public static void preview() throws Exception { JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请先在设置中填写并保存阿里云短信相关配置!", "提示", JOptionPane.INFORMATION_MESSAGE); + return false; } //初始化acsClient,暂不支持region化 @@ -170,6 +174,7 @@ public static void preview() throws Exception { JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请先在设置中填写并保存腾讯云短信相关配置!", "提示", JOptionPane.INFORMATION_MESSAGE); + return false; } SmsSingleSender ssender = new SmsSingleSender(Integer.valueOf(txyunAppId), txyunAppKey); @@ -194,6 +199,7 @@ public static void preview() throws Exception { JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请先在设置中填写并保存阿里大于相关配置!", "提示", JOptionPane.INFORMATION_MESSAGE); + return false; } TaobaoClient client = new DefaultTaobaoClient(aliServerUrl, aliAppKey, aliAppSecret); @@ -207,9 +213,32 @@ public static void preview() throws Exception { } } break; + case "云片网短信": + String yunpianApiKey = Init.configer.getYunpianApiKey(); + + if (StringUtils.isEmpty(yunpianApiKey)) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), + "请先在设置中填写并保存云片网短信相关配置!", "提示", + JOptionPane.INFORMATION_MESSAGE); + return false; + } + + YunpianClient clnt = new YunpianClient(yunpianApiKey).init(); + + for (String[] msgData : msgDataList) { + Map params = makeYunpianMessage(msgData); + params.put(YunpianClient.MOBILE, msgData[0]); + Result result = clnt.sms().single_send(params); + if (result.getCode() != 0) { + throw new Exception(result.toString()); + } + } + clnt.close(); + break; default: break; } + return true; } /** @@ -498,9 +527,6 @@ synchronized public static AlibabaAliqinFcSmsNumSendRequest makeAliTemplateMessa * @return */ synchronized public static String[] makeTxyunMessage(String[] msgData) { - // 模板参数 - Map paramMap = new HashMap<>(); - if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) { Init.initTemplateDataTable(); } @@ -509,7 +535,6 @@ synchronized public static String[] makeTxyunMessage(String[] msgData) { int rowCount = tableModel.getRowCount(); String[] params = new String[rowCount]; for (int i = 0; i < rowCount; i++) { - String key = (String) tableModel.getValueAt(i, 0); String value = ((String) tableModel.getValueAt(i, 1)).replaceAll("$ENTER$", "\n"); Pattern p = Pattern.compile("\\{([^{}]+)\\}"); Matcher matcher = p.matcher(value); @@ -523,6 +548,27 @@ synchronized public static String[] makeTxyunMessage(String[] msgData) { return params; } + /** + * 组织云片网短信消息 + * + * @param msgData + * @return + */ + synchronized static Map makeYunpianMessage(String[] msgData) { + Map params = new HashMap<>(2); + + String text = MainWindow.mainWindow.getMsgYunpianMsgContentTextField().getText(); + text = text.replaceAll("$ENTER$", "\n"); + Pattern p = Pattern.compile("\\{([^{}]+)\\}"); + Matcher matcher = p.matcher(text); + while (matcher.find()) { + text = text.replace(matcher.group(0), msgData[Integer.parseInt(matcher.group(1).trim())]); + } + + params.put(YunpianClient.TEXT, text); + return params; + } + /** * 微信公众号配置 * @@ -571,7 +617,10 @@ private static WxMaInMemoryConfig wxMaConfigStorage() { */ public static WxMpService getWxMpService() { WxMpService wxMpService = new WxMpServiceImpl(); - wxMpService.setWxMpConfigStorage(wxMpConfigStorage()); + WxMpConfigStorage wxMpConfigStorage = wxMpConfigStorage(); + if (wxMpConfigStorage != null) { + wxMpService.setWxMpConfigStorage(wxMpConfigStorage); + } return wxMpService; } diff --git a/src/main/java/com/fangxuele/tool/wechat/push/logic/RunPushThread.java b/src/main/java/com/fangxuele/tool/wechat/push/logic/RunPushThread.java index 84191c89..e51b7e66 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/logic/RunPushThread.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/logic/RunPushThread.java @@ -140,6 +140,9 @@ public void run() { } else if ("腾讯云短信".equals(msgType)) { thread = new TxYunSmsMsgServiceThread(i * pagePerThread, i * pagePerThread + pagePerThread - 1, pageSize); + } else if ("云片网短信".equals(msgType)) { + thread = new YunpianSmsMsgServiceThread(i * pagePerThread, + i * pagePerThread + pagePerThread - 1, pageSize); } thread.setName(new StringBuffer().append("T-").append(i).toString()); diff --git a/src/main/java/com/fangxuele/tool/wechat/push/logic/YunpianSmsMsgServiceThread.java b/src/main/java/com/fangxuele/tool/wechat/push/logic/YunpianSmsMsgServiceThread.java new file mode 100644 index 00000000..c6b7ca99 --- /dev/null +++ b/src/main/java/com/fangxuele/tool/wechat/push/logic/YunpianSmsMsgServiceThread.java @@ -0,0 +1,133 @@ +package com.fangxuele.tool.wechat.push.logic; + +import com.fangxuele.tool.wechat.push.ui.Init; +import com.fangxuele.tool.wechat.push.ui.MainWindow; +import com.github.qcloudsms.SmsSingleSender; +import com.github.qcloudsms.SmsSingleSenderResult; +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; + +/** + * 云片网短信发送服务线程 + * Created by rememberber(https://github.com/rememberber) on 2018/7/13. + */ +public class YunpianSmsMsgServiceThread extends BaseMsgServiceThread { + + /** + * 构造函数 + * + * @param pageFrom 起始页 + * @param pageTo 截止页 + * @param pageSize 页大小 + */ + public YunpianSmsMsgServiceThread(int pageFrom, int pageTo, int pageSize) { + super(pageFrom, pageTo, pageSize); + } + + @Override + public void run() { + + // 初始化当前线程 + initCurrentThread(); + + String yunpianApiKey = Init.configer.getYunpianApiKey(); + + if (StringUtils.isEmpty(yunpianApiKey)) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), + "请先在设置中填写并保存云片网短信相关配置!", "提示", + JOptionPane.INFORMATION_MESSAGE); + } + + YunpianClient clnt = new YunpianClient(yunpianApiKey).init(); + + for (int i = 0; i < list.size(); i++) { + if (!PushData.running) { + // 停止 + PushData.increaseStopedThread(); + return; + } + + // 本条消息所需的数据 + String[] msgData = list.get(i); + String telNum = msgData[0]; + try { + Map params = PushManage.makeYunpianMessage(msgData); + params.put(YunpianClient.MOBILE, telNum); + + // 空跑控制 + if (!MainWindow.mainWindow.getDryRunCheckBox().isSelected()) { + Result result = clnt.sms().single_send(params); + + if (result.getCode() == 0) { + // 总发送成功+1 + PushData.increaseSuccess(); + MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords)); + + // 当前线程发送成功+1 + currentThreadSuccessCount++; + tableModel.setValueAt(currentThreadSuccessCount, tableRow, 2); + + // 保存发送成功 + PushData.sendSuccessList.add(msgData); + } else { + // 总发送失败+1 + PushData.increaseFail(); + MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords)); + + // 保存发送失败 + PushData.sendFailList.add(msgData); + + // 失败异常信息输出控制台 + PushManage.console(new StringBuffer().append("发送失败:").append(result.toString()) + .append(";telNum:").append(telNum).toString()); + + // 当前线程发送失败+1 + currentThreadFailCount++; + tableModel.setValueAt(currentThreadFailCount, tableRow, 3); + } + } else { + // 总发送成功+1 + PushData.increaseSuccess(); + MainWindow.mainWindow.getPushSuccessCount().setText(String.valueOf(PushData.successRecords)); + + // 当前线程发送成功+1 + currentThreadSuccessCount++; + tableModel.setValueAt(currentThreadSuccessCount, tableRow, 2); + + // 保存发送成功 + PushData.sendSuccessList.add(msgData); + } + + } catch (Exception e) { + // 总发送失败+1 + PushData.increaseFail(); + MainWindow.mainWindow.getPushFailCount().setText(String.valueOf(PushData.failRecords)); + + // 保存发送失败 + PushData.sendFailList.add(msgData); + + // 失败异常信息输出控制台 + PushManage.console(new StringBuffer().append("发送失败:").append(e.getMessage()).append(";telNum:").append(telNum).toString()); + + // 当前线程发送失败+1 + currentThreadFailCount++; + tableModel.setValueAt(currentThreadFailCount, tableRow, 3); + } + // 当前线程进度条 + tableModel.setValueAt((int) ((double) (i + 1) / list.size() * 100), tableRow, 5); + + // 总进度条 + MainWindow.mainWindow.getPushTotalProgressBar().setValue((int) (PushData.successRecords + PushData.failRecords)); + } + + // 当前线程结束 + clnt.close(); + currentThreadFinish(); + } + +} diff --git a/src/main/java/com/fangxuele/tool/wechat/push/ui/ConstantsUI.java b/src/main/java/com/fangxuele/tool/wechat/push/ui/ConstantsUI.java index 7d898615..b2ae0952 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/ui/ConstantsUI.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/ui/ConstantsUI.java @@ -14,7 +14,7 @@ public class ConstantsUI { * 软件名称,版本 */ public final static String APP_NAME = "WePush"; - public final static String APP_VERSION = "v_2.2.1_180625"; + public final static String APP_VERSION = "v_2.3.0_180714"; /** * 主窗口图标 diff --git a/src/main/java/com/fangxuele/tool/wechat/push/ui/Init.java b/src/main/java/com/fangxuele/tool/wechat/push/ui/Init.java index 94b1183d..966ce7cf 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/ui/Init.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/ui/Init.java @@ -228,6 +228,7 @@ public static void initMsgTab(String selectedMsgName) { MainWindow.mainWindow.setMsgTemplateMiniAppidTextField(""); MainWindow.mainWindow.setMsgTemplateMiniPagePathTextField(""); MainWindow.mainWindow.setMsgTemplateKeyWordTextField(""); + MainWindow.mainWindow.setMsgYunpianMsgContentTextField(""); String msgName; if (StringUtils.isEmpty(selectedMsgName)) { @@ -254,6 +255,9 @@ public static void initMsgTab(String selectedMsgName) { MainWindow.mainWindow.setMsgKefuPicUrlTextField(msgDataArray[6]); MainWindow.mainWindow.setMsgKefuDescTextField(msgDataArray[7]); MainWindow.mainWindow.setMsgKefuUrlTextField(msgDataArray[8]); + if (msgDataArray.length > 11) { + MainWindow.mainWindow.setMsgYunpianMsgContentTextField(msgDataArray[12]); + } if (msgDataArray.length > 10) { MainWindow.mainWindow.setMsgTemplateKeyWordTextField(msgDataArray[11]); } @@ -301,9 +305,11 @@ public static void initMsgTab(String selectedMsgName) { * @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 "模板消息": - MainWindow.mainWindow.getKefuMsgPanel().setVisible(false); MainWindow.mainWindow.getTemplateMsgPanel().setVisible(true); MainWindow.mainWindow.getTemplateUrlLabel().setVisible(true); MainWindow.mainWindow.getMsgTemplateUrlTextField().setVisible(true); @@ -317,11 +323,9 @@ public static void switchMsgType(String msgType) { MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(true); MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(false); MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(false); - MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(以半角分号分隔)"); - + MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)"); break; case "模板消息-小程序": - MainWindow.mainWindow.getKefuMsgPanel().setVisible(false); MainWindow.mainWindow.getTemplateMsgPanel().setVisible(true); MainWindow.mainWindow.getTemplateUrlLabel().setVisible(true); MainWindow.mainWindow.getMsgTemplateUrlTextField().setVisible(true); @@ -335,12 +339,11 @@ public static void switchMsgType(String msgType) { MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(true); MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(true); MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(true); - MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(以半角分号分隔)"); - + MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)"); break; case "客服消息": MainWindow.mainWindow.getKefuMsgPanel().setVisible(true); - MainWindow.mainWindow.getTemplateMsgPanel().setVisible(false); + MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)"); break; case "客服消息优先": MainWindow.mainWindow.getKefuMsgPanel().setVisible(true); @@ -357,12 +360,11 @@ public static void switchMsgType(String msgType) { MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(true); MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(false); MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(false); - MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(以半角分号分隔)"); + MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户openid(多个以半角分号分隔)"); break; case "阿里云短信": case "腾讯云短信": case "阿里大于模板短信": - MainWindow.mainWindow.getKefuMsgPanel().setVisible(false); MainWindow.mainWindow.getTemplateMsgPanel().setVisible(true); MainWindow.mainWindow.getTemplateUrlLabel().setVisible(false); MainWindow.mainWindow.getMsgTemplateUrlTextField().setVisible(false); @@ -376,7 +378,11 @@ public static void switchMsgType(String msgType) { MainWindow.mainWindow.getTemplateDataColorTextField().setVisible(false); MainWindow.mainWindow.getMsgTemplateKeyWordTextField().setVisible(false); MainWindow.mainWindow.getTemplateKeyWordLabel().setVisible(false); - MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户手机号(以半角分号分隔)"); + MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户手机号(多个以半角分号分隔)"); + break; + case "云片网短信": + MainWindow.mainWindow.getYunpianMsgPanel().setVisible(true); + MainWindow.mainWindow.getPreviewMemberLabel().setText("预览消息用户手机号(多个以半角分号分隔)"); break; default: break; @@ -537,6 +543,9 @@ public static void initSettingTab() { MainWindow.mainWindow.setTxyunAppKeyTextField(configer.getTxyunAppKey()); MainWindow.mainWindow.setTxyunSignTextField(configer.getTxyunSign()); + // 云片网短信 + MainWindow.mainWindow.setYunpianApiKeyTextField(configer.getYunpianApiKey()); + // MySQL MainWindow.mainWindow.setMysqlUrlTextField(configer.getMysqlUrl()); MainWindow.mainWindow.setMysqlDatabaseTextField(configer.getMysqlDatabase()); diff --git a/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.form b/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.form index bd67969d..0fd0bd75 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.form +++ b/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.form @@ -15,6 +15,7 @@ + @@ -134,7 +135,7 @@ - + @@ -145,11 +146,13 @@ - + + + - - + + @@ -160,10 +163,10 @@ - - + + - + @@ -191,6 +194,7 @@ + @@ -212,12 +216,6 @@ - - - - - - @@ -231,7 +229,7 @@ - + @@ -272,9 +270,9 @@ - + - + @@ -321,7 +319,7 @@ - + @@ -477,9 +475,9 @@ - + - + @@ -584,9 +582,34 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1507,7 +1530,7 @@ - + @@ -1523,8 +1546,8 @@ - - + + @@ -1642,13 +1665,13 @@ - + - + @@ -1874,7 +1897,7 @@ - + @@ -2322,6 +2345,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.java b/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.java index 7709a815..51653723 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/ui/MainWindow.java @@ -182,6 +182,10 @@ public class MainWindow { private JPasswordField txyunAppKeyTextField; private JTextField txyunSignTextField; private JButton settingTxyunSaveButton; + private JPasswordField yunpianApiKeyTextField; + private JButton settingYunpianSaveButton; + private JTextArea msgYunpianMsgContentTextField; + private JPanel yunpianMsgPanel; public static JFrame frame; public static MainWindow mainWindow; @@ -1497,6 +1501,38 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { this.settingTxyunSaveButton = settingTxyunSaveButton; } + public JPasswordField getYunpianApiKeyTextField() { + return yunpianApiKeyTextField; + } + + public void setYunpianApiKeyTextField(String yunpianApiKeyTextField) { + this.yunpianApiKeyTextField.setText(yunpianApiKeyTextField); + } + + public JButton getSettingYunpianSaveButton() { + return settingYunpianSaveButton; + } + + public void setSettingYunpianSaveButton(JButton settingYunpianSaveButton) { + this.settingYunpianSaveButton = settingYunpianSaveButton; + } + + public JPanel getYunpianMsgPanel() { + return yunpianMsgPanel; + } + + public void setYunpianMsgPanel(JPanel yunpianMsgPanel) { + this.yunpianMsgPanel = yunpianMsgPanel; + } + + public JTextArea getMsgYunpianMsgContentTextField() { + return msgYunpianMsgContentTextField; + } + + public void setMsgYunpianMsgContentTextField(String msgYunpianMsgContentTextField) { + this.msgYunpianMsgContentTextField.setText(msgYunpianMsgContentTextField); + } + { // GUI initializer generated by IntelliJ IDEA GUI Designer // >>> IMPORTANT!! <<< @@ -1515,6 +1551,7 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { mainPanel = new JPanel(); mainPanel.setLayout(new GridLayoutManager(1, 1, new Insets(8, 0, 0, 0), -1, -1)); tabbedPane = new JTabbedPane(); + tabbedPane.setDoubleBuffered(true); Font tabbedPaneFont = this.$$$getFont$$$(null, -1, -1, tabbedPane.getFont()); 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)); @@ -1569,19 +1606,20 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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("查看更多在线帮助文档:https://gitee.com/zhoubochina/WePush/wikis/help"); + 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)); messagePanel = new JSplitPane(); + messagePanel.setDoubleBuffered(true); tabbedPane.addTab("编辑消息", messagePanel); final JPanel panel2 = new JPanel(); - panel2.setLayout(new GridLayoutManager(3, 4, new Insets(0, 0, 0, 0), -1, -1)); + 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(2, 7, new Insets(0, 0, 0, 0), -1, -1)); - panel2.add(panel3, new GridConstraints(0, 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)); + 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); @@ -1596,6 +1634,7 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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(); @@ -1605,14 +1644,12 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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)); - final JSeparator separator1 = new JSeparator(); - panel3.add(separator1, new GridConstraints(1, 0, 1, 7, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, 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(2, 0, 1, 4, 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)); + 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)); @@ -1625,8 +1662,8 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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, 10, 0), -1, -1)); - panel2.add(templateMsgPanel, 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)); + 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"); @@ -1641,7 +1678,7 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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)); + 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)); @@ -1693,8 +1730,8 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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, 10, 0), -1, -1)); - panel2.add(kefuMsgPanel, new GridConstraints(1, 2, 1, 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.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("消息类型"); @@ -1728,19 +1765,27 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + 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 scrollPane3 = new JScrollPane(); - panel5.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)); + 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); - scrollPane3.setViewportView(msgHistable); + 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)); @@ -1774,8 +1819,8 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { final JLabel label4 = new JLabel(); label4.setText("已导入"); memberTabUpPanel.add(label4, 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 separator2 = new JSeparator(); - memberTabUpPanel.add(separator2, 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)); + 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)); @@ -1828,8 +1873,8 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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 separator3 = new JSeparator(); - memberPanel.add(separator3, 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 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)); @@ -1898,9 +1943,9 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { final JLabel label8 = new JLabel(); label8.setText("失败"); pushUpPanel.add(label8, 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 separator4 = new JSeparator(); - separator4.setOrientation(1); - pushUpPanel.add(separator4, 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)); + 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()); @@ -1917,9 +1962,9 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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 separator5 = new JSeparator(); - separator5.setOrientation(1); - pushUpPanel.add(separator5, new GridConstraints(0, 7, 6, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_WANT_GROW, 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)); @@ -1979,16 +2024,16 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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 scrollPane4 = new JScrollPane(); - pushCenterPanel.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)); - pushConsoleTextArea = new JTextArea(); - scrollPane4.setViewportView(pushConsoleTextArea); final JScrollPane scrollPane5 = new JScrollPane(); - pushCenterPanel.add(scrollPane5, 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)); + 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); - scrollPane5.setViewportView(pushThreadTable); + scrollPane6.setViewportView(pushThreadTable); schedulePanel = new JPanel(); schedulePanel.setLayout(new GridLayoutManager(5, 7, new Insets(10, 10, 10, 10), -1, -1)); tabbedPane.addTab("计划任务", schedulePanel); @@ -2067,11 +2112,11 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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 scrollPane6 = new JScrollPane(); - panel9.add(scrollPane6, 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 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); - scrollPane6.setViewportView(pushHisLeftTable); + 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); @@ -2086,20 +2131,20 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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 scrollPane7 = new JScrollPane(); - panel11.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)); + 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); - scrollPane7.setViewportView(pushHisTextArea); + scrollPane8.setViewportView(pushHisTextArea); settingPanel = new JPanel(); - settingPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1)); + 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(9, 1, new Insets(0, 0, 0, 0), -1, -1)); + 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)); @@ -2140,10 +2185,10 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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(8, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + 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(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)); + 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 label22 = new JLabel(); label22.setText("数据库地址"); @@ -2218,7 +2263,7 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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(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)); + 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 label30 = new JLabel(); label30.setText("主题风格"); @@ -2394,33 +2439,55 @@ public void setSettingTxyunSaveButton(JButton settingTxyunSaveButton) { 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(2, 1, new Insets(0, 0, 10, 0), -1, -1)); - tabbedPane.addTab("他们都在用", panel29); + 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 label43 = new JLabel(); + label43.setText("ApiKey"); + panel29.add(label43, 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(); - panel29.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)); + 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 panel30 = new JPanel(); - panel30.setLayout(new GridLayoutManager(5, 1, new Insets(10, 10, 0, 0), -1, -1)); - panel29.add(panel30, 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("产品信息将会在这里展示,帮助宣传您的产品"); - panel30.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 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 label44 = new JLabel(); - Font label44Font = this.$$$getFont$$$(null, Font.BOLD, -1, label44.getFont()); - if (label44Font != null) label44.setFont(label44Font); - label44.setText("WePush不会收集用户的任何信息"); - panel30.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)); + label44.setText("产品信息将会在这里展示,帮助宣传您的产品"); + panel32.add(label44, 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 label45 = new JLabel(); - label45.setText("也正因如此,我无法得知哪些优秀的企业或个人在使用她"); - panel30.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)); + Font label45Font = this.$$$getFont$$$(null, Font.BOLD, -1, label45.getFont()); + if (label45Font != null) label45.setFont(label45Font); + label45.setText("WePush不会收集用户的任何信息"); + panel32.add(label45, 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 label46 = new JLabel(); - label46.setText("如果WePush能给您带来一些便利"); - panel30.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)); + label46.setText("也正因如此,我无法得知哪些优秀的企业或个人在使用她"); + panel32.add(label46, 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 label47 = new JLabel(); - label47.setText("欢迎将您的产品邮件告诉我:rememberber@163.com"); - panel30.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)); + label47.setText("如果WePush能给您带来一些便利"); + panel32.add(label47, 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 label48 = new JLabel(); + label48.setText("欢迎将您的产品邮件告诉我:rememberber@163.com"); + panel32.add(label48, 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); diff --git a/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/MsgListener.java b/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/MsgListener.java index 7b19dfa2..d32805b9 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/MsgListener.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/MsgListener.java @@ -31,17 +31,14 @@ public static void addListeners() { MainWindow.mainWindow.getMsgHistable().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { - new Thread(new Runnable() { - @Override - public void run() { - MainWindow.mainWindow.getPushHisTextArea().setText(""); + new Thread(() -> { + MainWindow.mainWindow.getPushHisTextArea().setText(""); - int selectedRow = MainWindow.mainWindow.getMsgHistable().getSelectedRow(); - String selectedMsgName = MainWindow.mainWindow.getMsgHistable() - .getValueAt(selectedRow, 1).toString(); + int selectedRow = MainWindow.mainWindow.getMsgHistable().getSelectedRow(); + String selectedMsgName = MainWindow.mainWindow.getMsgHistable() + .getValueAt(selectedRow, 1).toString(); - Init.initMsgTab(selectedMsgName); - } + Init.initMsgTab(selectedMsgName); }).start(); super.mouseClicked(e); } @@ -94,6 +91,11 @@ public void run() { // 保存按钮事件 MainWindow.mainWindow.getMsgSaveButton().addActionListener(e -> { String msgName = MainWindow.mainWindow.getMsgNameField().getText(); + if (StringUtils.isBlank(msgName)) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "请填写推送任务名称!\n\n", "失败", + JOptionPane.ERROR_MESSAGE); + return; + } Map msgMap = msgHisManager.readMsgHis(); int isCover = JOptionPane.NO_OPTION; @@ -118,6 +120,7 @@ public void run() { 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); @@ -149,9 +152,10 @@ public void run() { JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "预览消息用户不能为空!", "提示", JOptionPane.INFORMATION_MESSAGE); } else { - PushManage.preview(); - JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "发送预览消息成功!", "成功", - JOptionPane.INFORMATION_MESSAGE); + if (PushManage.preview()) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "发送预览消息成功!", "成功", + JOptionPane.INFORMATION_MESSAGE); + } } } catch (Exception e1) { JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "发送预览消息失败!\n\n" + e1.getMessage(), "失败", @@ -172,6 +176,7 @@ public void run() { MainWindow.mainWindow.setMsgTemplateMiniAppidTextField(""); MainWindow.mainWindow.setMsgTemplateMiniPagePathTextField(""); MainWindow.mainWindow.setMsgTemplateKeyWordTextField(""); + MainWindow.mainWindow.getMsgYunpianMsgContentTextField().setText(""); if (MainWindow.mainWindow.getTemplateMsgDataTable().getModel().getRowCount() == 0) { Init.initTemplateDataTable(); diff --git a/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/SettingListener.java b/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/SettingListener.java index 7e23b33c..99473a9f 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/SettingListener.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/SettingListener.java @@ -118,6 +118,21 @@ public static void addListeners() { } }); + // 设置-云片网短信-保存 + MainWindow.mainWindow.getSettingYunpianSaveButton().addActionListener(e -> { + try { + Init.configer.setYunpianApiKey(new String(MainWindow.mainWindow.getYunpianApiKeyTextField().getPassword())); + Init.configer.save(); + + 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); + } + }); + // mysql数据库-测试链接 MainWindow.mainWindow.getSettingTestDbLinkButton().addActionListener(e -> { try { diff --git a/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/TabListener.java b/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/TabListener.java index 464f8a27..33d61ea8 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/TabListener.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/ui/listener/TabListener.java @@ -6,6 +6,7 @@ import com.fangxuele.tool.wechat.push.ui.Init; import com.fangxuele.tool.wechat.push.ui.MainWindow; +import javax.swing.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -17,6 +18,8 @@ public class TabListener { private static final Log logger = LogFactory.get(); + private static boolean warnFlag = true; + public static void addListeners() { // 暂时停止使用,仅留作demo,日后需要时再使用 MainWindow.mainWindow.getTabbedPane().addMouseListener(new MouseAdapter() { @@ -28,13 +31,21 @@ public void mouseClicked(MouseEvent e) { case 6: Init.initPushHisTab(); break; + case 3: + if (warnFlag) { + JOptionPane.showMessageDialog(MainWindow.mainWindow.getSettingPanel(), "\n请确认您了解所要发送消息类型的使用频率、使用规范和限制规则,\n" + + "以免账号相关功能被封禁等给您带来麻烦", "提示", + JOptionPane.INFORMATION_MESSAGE); + warnFlag = false; + } + break; case 4: MainWindow.mainWindow.setPushMsgName(MainWindow.mainWindow.getMsgNameField().getText()); if (PushData.allUser != null && PushData.allUser.size() > 0) { PushListener.refreshPushInfo(); } - + break; default: break; } diff --git a/src/main/java/com/fangxuele/tool/wechat/push/util/Config.java b/src/main/java/com/fangxuele/tool/wechat/push/util/Config.java index afef9e65..c7d3f337 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/util/Config.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/util/Config.java @@ -110,6 +110,8 @@ public class Config { private String txyunSign; + private String yunpianApiKey; + private String mysqlUrl; private String mysqlDatabase; @@ -229,6 +231,7 @@ private void originInit() { 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", ""); @@ -639,4 +642,12 @@ public String getTxyunSign() { public void setTxyunSign(String txyunSign) { props.setProperty("setting.txyun.txyunSign", txyunSign); } + + public String getYunpianApiKey() { + return props.getProperty("setting.yunpian.apiKey"); + } + + public void setYunpianApiKey(String yunpianApiKey) { + props.setProperty("setting.yunpian.apiKey", yunpianApiKey); + } } diff --git a/src/main/java/com/fangxuele/tool/wechat/push/util/SystemUtil.java b/src/main/java/com/fangxuele/tool/wechat/push/util/SystemUtil.java index d01f0472..7df6b1ed 100644 --- a/src/main/java/com/fangxuele/tool/wechat/push/util/SystemUtil.java +++ b/src/main/java/com/fangxuele/tool/wechat/push/util/SystemUtil.java @@ -17,4 +17,4 @@ public static boolean isMacOs() { return false; } } -} +} \ No newline at end of file diff --git a/src/main/resources/version_summary.json b/src/main/resources/version_summary.json index 49a00da2..277d8535 100644 --- a/src/main/resources/version_summary.json +++ b/src/main/resources/version_summary.json @@ -1,5 +1,5 @@ { - "currentVersion": "v_2.2.1_180625", + "currentVersion": "v_2.3.0_180714", "versionIndex": { "v_1.1.0_170701": "0", "v_1.2.0_170831": "1", @@ -16,7 +16,8 @@ "v_2.0.2_180401": "12", "v_2.1.0_180509": "12", "v_2.2.0_180516": "13", - "v_2.2.1_180625": "14" + "v_2.2.1_180625": "14", + "v_2.3.0_180714": "15" }, "versionDetailList": [ { @@ -98,6 +99,11 @@ "version": "v_2.2.1_180625", "title": "修复模板消息跳转小程序路径问题", "log": "1.升级weixin-java-tools版本,修复模板消息跳转小程序路径问题\n" + }, + { + "version": "v_2.3.0_180714", + "title": "新增支持云片网短信", + "log": "1.新增支持云片网短信\n2.多处界面优化\n3.bug修复,优化性能\n" } ] } \ No newline at end of file