puzhibing
2024-12-18 1f7f2beb1d8a63ddfbb69181453b047ca5c7b3a0
Merge remote-tracking branch 'origin/master'
4个文件已修改
58 ■■■■■ 已修改文件
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/BalanceChangeRecordMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/BalanceChangeRecordMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/BalanceChangeRecordMapper.java
@@ -9,4 +9,7 @@
public interface BalanceChangeRecordMapper extends BaseMapper<BalanceChangeRecord> {
    IPage<BalanceChangeRecord> pageList(@Param("page") Page<BalanceChangeRecord> page,@Param("agentQuery") BalanceQuery agentQuery);
    IPage<BalanceChangeRecord> queryCommissionStatistics(@Param("page") Page<BalanceChangeRecord> page,
                                                         @Param("changeRecord") BalanceChangeRecord changeRecord);
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java
@@ -38,25 +38,8 @@
    @Override
    public CommissionStatistics commissionStatistics(Page<BalanceChangeRecord> page, BalanceChangeRecord balanceChangeRecord) {
        List<AppUser> appUserList = appUserService.list(new LambdaQueryWrapper<AppUser>()
                .like(StringUtils.isNotEmpty(balanceChangeRecord.getUserName()), AppUser::getName, balanceChangeRecord.getUserName())
                .like(StringUtils.isNotEmpty(balanceChangeRecord.getUserPhone()), AppUser::getPhone, balanceChangeRecord.getUserPhone()));
        if (CollectionUtils.isEmpty(appUserList)){
            return new CommissionStatistics();
        }
        List<Long> appUserIds = appUserList.stream().map(AppUser::getId).collect(Collectors.toList());
        BigDecimal totalCommission = appUserList.stream()
                .map(AppUser::getTotalDistributionAmount)
                .reduce(BigDecimal.ZERO, BigDecimal::add);
        Page<BalanceChangeRecord> changeRecordPage = page(page, new LambdaQueryWrapper<BalanceChangeRecord>()
                .in(BalanceChangeRecord::getAppUserId, appUserIds)
                .between(balanceChangeRecord.getStartTime() != null && balanceChangeRecord.getEndTime() != null,
                        BalanceChangeRecord::getCreateTime, balanceChangeRecord.getStartTime(), balanceChangeRecord.getEndTime()));
        return new CommissionStatistics(totalCommission, changeRecordPage);
        IPage<BalanceChangeRecord> balanceChangeRecordIPage = this.baseMapper.queryCommissionStatistics(page, balanceChangeRecord);
//        return new CommissionStatistics(totalCommission, changeRecordPage);
        return null;
    }
}
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/BalanceChangeRecordMapper.xml
@@ -21,4 +21,27 @@
                    </if>
                </where>
    </select>
    <select id="queryCommissionStatistics" resultType="com.ruoyi.account.api.model.BalanceChangeRecord">
        SELECT
            tcr.*,
            tau.`name` userName,
            tau.phone userPhone
        FROM
            t_balance_change_record tcr
                LEFT JOIN t_app_user tau ON tcr.app_user_id = tau.id
        <where>
            <if test="changeRecord.userName != null and changeRecord.userName != ''">
                and tau.name like concat('%',#{changeRecord.userName},'%')
            </if>
            <if test="changeRecord.userPhone != null and changeRecord.userPhone != ''">
                and tau.phone like concat('%',#{changeRecord.userPhone},'%')
            </if>
            <if test="changeRecord.changeType != null">
                and tcr.change_type = #{changeRecord.changeType}
            </if>
            <if test="changeRecord.startTime != null and changeRecord.endTime != null">
                and DATE(tcr.create_time) between  #{changeRecord.startTime} and #{changeRecord.endTime}
            </if>
        </where>
    </select>
</mapper>
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java
@@ -14,10 +14,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDateTime;
@@ -60,9 +57,9 @@
    /**
     * 审核
     */
    @RequestMapping("/audit")
    @PostMapping("/audit")
    @ApiOperation("审核")
    public R<Void> audit(ShopWithdraw shopWithdraw) {
    public R<Void> audit(@RequestBody ShopWithdraw shopWithdraw) {
        LoginUser loginUser = tokenService.getLoginUser();
        ShopWithdraw shopWithdraw1 = shopWithdrawService.getById(shopWithdraw.getId());
        shopWithdraw1.setAuditStatus(shopWithdraw.getAuditStatus());