parent
839033b7f7
commit
bd5b1541af
@ -0,0 +1,43 @@
|
||||
package au.com.royalpay.payment.manage.task;
|
||||
|
||||
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
|
||||
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
||||
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "false")
|
||||
public class UpdatePartnerPasswordTask {
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Resource
|
||||
private ClientManager clientManager;
|
||||
@Resource
|
||||
private SynchronizedScheduler synchronizedScheduler;
|
||||
@Resource
|
||||
private ManagerMapper managerMapper;
|
||||
|
||||
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";
|
||||
|
||||
@Scheduled(cron = "0 0 9 28 * ?")
|
||||
public void resetPartnerPassword() {
|
||||
synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 120_000, () -> {
|
||||
final List<String> emails = managerMapper.listDevManager();
|
||||
List<String> emailList = Arrays.asList(EMAIL.split(","));
|
||||
emailList.stream().forEach(email -> {
|
||||
if (!emails.contains(email)) {
|
||||
emails.add(email);
|
||||
}
|
||||
});
|
||||
clientManager.updateAllPartnerPassword("PINE", emails);
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
|
||||
|
||||
<style type="text/css">
|
||||
table.gridtable {
|
||||
font-family: verdana,arial,sans-serif;
|
||||
font-size:11px;
|
||||
color:#333333;
|
||||
border-width: 1px;
|
||||
border-color: #666666;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.gridtable th {
|
||||
border-width: 1px;
|
||||
padding: 8px;
|
||||
border-style: solid;
|
||||
border-color: #666666;
|
||||
background-color: #dedede;
|
||||
}
|
||||
table.gridtable td {
|
||||
border-width: 1px;
|
||||
padding: 8px;
|
||||
border-style: solid;
|
||||
border-color: #666666;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<table class="gridtable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>商户</th>
|
||||
<th>角色</th>
|
||||
<th>用户名</th>
|
||||
<th>密码</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="account : ${accounts}">
|
||||
<td th:text="${accountStat.index} + 1"></td>
|
||||
<td th:text="${account.client_moniker}"></td>
|
||||
<td th:if="${account.role} == 1">admin</td>
|
||||
<td th:if="${account.role} == 2">Manager</td>
|
||||
<td th:if="${account.role} == 3">Cashier</td>
|
||||
<td th:text="${account.username}"></td>
|
||||
<td th:text="${account.password}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</html>
|
Loading…
Reference in new issue