phpcjl
2024-12-04 c7df3e9db6003f90d9dbfb62db3153e2f14306bd
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java
@@ -12,11 +12,16 @@
import com.ruoyi.system.api.model.LoginUser;
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 javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
@Api(tags = "小程序-个人中心-我的钱包")
@@ -46,9 +51,21 @@
     */
    @ApiOperation(value = "变更明细", notes = "变更明细")
    @GetMapping("change")
    public R<List<BalanceChangeRecord>> change() {
    public R<List<BalanceChangeRecord>> change(@ApiParam(value = "变更类型", required = false)
                                               @RequestParam(required = false) Integer changeType,
                                               @ApiParam(value = "创建时间", required = false)
                                               @RequestParam(required = false) LocalDate createTime) {
        Long userId = SecurityUtils.getUserId();
        LocalDateTime localDateTime = null;
        if (createTime != null) {
            LocalTime specificTime = LocalTime.of(0, 0);
            localDateTime = createTime.atTime(specificTime);
        }
        return R.ok(balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>()
                .eq(changeType != null, BalanceChangeRecord::getChangeType, changeType)
                .eq(createTime != null, BalanceChangeRecord::getCreateTime, localDateTime)
                .eq(BalanceChangeRecord::getAppUserId, userId)));
    }