重置pine商户下账户密码

master
yangkai 6 years ago
parent 71bad3b7c3
commit 62787070db

@ -21,6 +21,7 @@ import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; import au.com.royalpay.payment.manage.mappers.payment.RefundMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper; import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
@ -56,6 +57,8 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -113,6 +116,9 @@ public class TestController implements ApplicationEventPublisherAware {
private HfClearAmountService hfClearAmountService; private HfClearAmountService hfClearAmountService;
@Resource @Resource
private HfUpdateService hfUpdateService; private HfUpdateService hfUpdateService;
@Resource
private ClientManager clientManager;
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
@ -416,4 +422,16 @@ public class TestController implements ApplicationEventPublisherAware {
public String rpayUpdateClearing() { public String rpayUpdateClearing() {
return hfUpdateService.rpayUpdate(); return hfUpdateService.rpayUpdate();
} }
@ManagerMapping(value = "/partner", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
public void resetPartnerPassword() {
final List<String> emails = new ArrayList<>();
List<String> emailList = Arrays.asList(EMAIL.split(","));
emailList.stream().forEach(email -> {
if (!emails.contains(email)) {
emails.add(email);
}
});
clientManager.updateAllPartnerPassword("PINE", emails);
}
} }

@ -10,6 +10,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -24,13 +25,12 @@ public class UpdatePartnerPasswordTask {
@Resource @Resource
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au," + private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
"astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
@Scheduled(cron = "0 0 9 28 * ?") @Scheduled(cron = "0 0 9 28 * ?")
public void resetPartnerPassword() { public void resetPartnerPassword() {
synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 120_000, () -> { synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 300_000, () -> {
final List<String> emails = managerMapper.listDevManager(); final List<String> emails = new ArrayList<>();
List<String> emailList = Arrays.asList(EMAIL.split(",")); List<String> emailList = Arrays.asList(EMAIL.split(","));
emailList.stream().forEach(email -> { emailList.stream().forEach(email -> {
if (!emails.contains(email)) { if (!emails.contains(email)) {

@ -18,7 +18,7 @@
</where> </where>
</select> </select>
<select id="partnerAndSubPartnerAccounts" resultType="com.alibaba.fastjson.JSONObject"> <select id="partnerAndSubPartnerAccounts" resultType="com.alibaba.fastjson.JSONObject">
SELECT sc.client_moniker, sa.* SELECT sc.client_moniker, sa.account_id, sa.role, sa.username
FROM sys_clients sc FROM sys_clients sc
INNER JOIN sys_accounts sa ON sc.client_id = sa.client_id AND sa.is_valid = 1 INNER JOIN sys_accounts sa ON sc.client_id = sa.client_id AND sa.is_valid = 1
WHERE sc.client_id = #{client_id} OR sc.parent_client_id = #{client_id} AND sc.is_valid = 1 WHERE sc.client_id = #{client_id} OR sc.parent_client_id = #{client_id} AND sc.is_valid = 1

Loading…
Cancel
Save