|
|
@ -154,13 +154,8 @@ import java.math.BigDecimal;
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
@ -1175,6 +1170,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
if (client == null) {
|
|
|
|
if (client == null) {
|
|
|
|
throw new NotFoundException("Client Not Exists");
|
|
|
|
throw new NotFoundException("Client Not Exists");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (channel.equals("hf") && !allow && client.getBoolean("enable_hf_email_notice")) {
|
|
|
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_hf_email_notice", allow));
|
|
|
|
|
|
|
|
}
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
|
|
|
|
logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel "
|
|
|
|
logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel "
|
|
|
|
+ channel + " to " + allow);
|
|
|
|
+ channel + " to " + allow);
|
|
|
@ -3754,6 +3752,34 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void sendHfEmailNotice(JSONObject order) {
|
|
|
|
|
|
|
|
JSONObject client = clientMapper.findClient(order.getIntValue("client_id"));
|
|
|
|
|
|
|
|
JSONObject clientConfig = clientConfigMapper.find(order.getIntValue("client_id"));
|
|
|
|
|
|
|
|
if (client == null || clientConfig == null) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (client.getString("contact_email") == null ||
|
|
|
|
|
|
|
|
!clientConfig.getBoolean("enable_hf_email_notice")) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Context ctx = new Context();
|
|
|
|
|
|
|
|
ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png"));
|
|
|
|
|
|
|
|
ctx.setVariable("name", client.getString("contact_person"));
|
|
|
|
|
|
|
|
ctx.setVariable("order_id", order.getString("order_id"));
|
|
|
|
|
|
|
|
ctx.setVariable("amount", order.getString("total_amount"));
|
|
|
|
|
|
|
|
ctx.setVariable("time", order.getString("create_time"));
|
|
|
|
|
|
|
|
final String content = thymeleaf.process( "mail/hf_email_notice", ctx);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new Thread(() -> {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
mailService.sendEmail("你刚刚有一笔到账信息", client.getString("contact_email"), "", content);
|
|
|
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
|
|
|
logger.error("邮件发送失败", ignored);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).start();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String getShortLink(String clientMoniker) {
|
|
|
|
public String getShortLink(String clientMoniker) {
|
|
|
|
String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump");
|
|
|
|
String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump");
|
|
|
|