Compare commits
2 Commits
d657598d59
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| c33a55c2fb | |||
| 3811eec33f |
@@ -142,4 +142,13 @@ public interface ManageBroadcastMapper extends BaseMapper<ManageBroadcast> {
|
||||
* @return
|
||||
*/
|
||||
boolean updateUserAccountBalanceStatusByIds(@Param("ids") List<Long> ids, @Param("newStatus") int newStatus);
|
||||
|
||||
/**
|
||||
* 更新只读页面表状态
|
||||
* @param coin 币种
|
||||
* @param oldStatus 旧状态
|
||||
* @param newStatus 新状态
|
||||
* @return
|
||||
*/
|
||||
boolean updatePageInfoStatus(@Param("coin") String coin, @Param("oldStatus") int oldStatus, @Param("newStatus") int newStatus);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.m2pool.manage.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.m2pool.common.core.Result.R;
|
||||
@@ -249,17 +250,16 @@ public class ManageUserServiceImpl implements ManageUserService {
|
||||
public TableDataInfo<SummaryOfPendingPaymentsDto> summaryOfPendingPayments(PageVo pageVo) {
|
||||
PageHelper.startPage(pageVo.getPageNum(), pageVo.getPageSize());
|
||||
List<SummaryOfPendingPaymentsDto> summaryOfPendingPaymentsList = manageWalletOutInMapper.summaryOfPendingPayments();
|
||||
System.out.println("起付额:"+summaryOfPendingPaymentsList);
|
||||
//查询起付额
|
||||
List<SummaryOfPendingPaymentsDto> startPayments = manageBroadcastMapper.getStartPayments(summaryOfPendingPaymentsList);
|
||||
|
||||
// 创建一个 Map 用于存储第二个集合中元素的 user 和 coin 组合对应的 startPayAmount . 这里可以优化一下,防止多key报错,不过一般不出这个问题
|
||||
// 创建一个 Map 用于存储第二个集合中元素的 user 和 coin 组合对应的 startPayAmount
|
||||
Map<String, BigDecimal> startPayAmountMap = startPayments.stream()
|
||||
.collect(Collectors.toMap(
|
||||
dto -> dto.getUser() + "_" + dto.getCoin(),
|
||||
SummaryOfPendingPaymentsDto::getStartPayAmount
|
||||
SummaryOfPendingPaymentsDto::getStartPayAmount,
|
||||
(existing, replacement) -> replacement
|
||||
));
|
||||
System.out.println("起付额22:"+startPayAmountMap);
|
||||
|
||||
// 遍历第一个集合,根据 user 和 coin 从 Map 中查找对应的 startPayAmount 并填充
|
||||
for (SummaryOfPendingPaymentsDto dto : summaryOfPendingPaymentsList) {
|
||||
String key = dto.getUser() + "_" + dto.getCoin();
|
||||
@@ -311,8 +311,9 @@ public class ManageUserServiceImpl implements ManageUserService {
|
||||
if (!balanceIds.isEmpty()) {
|
||||
result2 = manageBroadcastMapper.updateUserAccountBalanceStatusByIds(balanceIds, 5);
|
||||
}
|
||||
boolean result3 = manageBroadcastMapper.updatePageInfoStatus(coinVo.getCoin(), 0, 5);
|
||||
|
||||
return (result1 && result2) ? R.success("删除成功") : R.fail("删除失败");
|
||||
return (result1 && result2 && result3) ? R.success("删除成功") : R.fail("删除失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -344,7 +345,8 @@ public class ManageUserServiceImpl implements ManageUserService {
|
||||
if (!balanceIds.isEmpty()) {
|
||||
result2 = manageBroadcastMapper.updateUserAccountBalanceStatusByIds(balanceIds, 0);
|
||||
}
|
||||
boolean result3 = manageBroadcastMapper.updatePageInfoStatus(coinVo.getCoin(), 5, 0);
|
||||
|
||||
return (result1 && result2) ? R.success("添加成功") : R.fail("添加失败");
|
||||
return (result1 && result2 && result3) ? R.success("添加成功") : R.fail("添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,10 +167,9 @@
|
||||
user_account_balance uab
|
||||
JOIN user_miner_account uma ON uma.id = uab.ma_id
|
||||
WHERE
|
||||
uab.status = 0 AND (
|
||||
<foreach collection="list" item="item" separator="OR">
|
||||
(`miner_user` = #{item.user} AND coin = #{item.coin})
|
||||
</foreach>)
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getAccountIdsByCoinAndStatus" resultType="com.m2pool.manage.dto.AccountIdsDto">
|
||||
@@ -193,10 +192,14 @@
|
||||
</update>
|
||||
|
||||
<update id="updateUserAccountBalanceStatusByIds">
|
||||
UPDATE user_account_balance SET status = #{newStatus} WHERE ma_id IN
|
||||
UPDATE user_account_balance SET status = #{newStatus} WHERE id IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updatePageInfoStatus">
|
||||
UPDATE user_page_info SET status = #{newStatus} WHERE coin = #{coin} AND status = #{oldStatus}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user