package com.ylx.shopingfundsdetail.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ylx.massage.domain.TWxUser;
import com.ylx.massage.service.TWxUserService;
import com.ylx.shopingfundsdetail.domain.ShoppingFundsDetail;
import com.ylx.shopingfundsdetail.domain.dto.ShoppingFundsDetailQueryDto;
import com.ylx.shopingfundsdetail.domain.vo.ShoppingFundsDetailAddDto;
import com.ylx.shopingfundsdetail.domain.vo.ShoppingFundsDetailQueryVo;
import com.ylx.shopingfundsdetail.mapper.ShoppingFundsDetailMapper;
import com.ylx.shopingfundsdetail.service.ShoppingFundsDetailService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 类描述：
 *
 * @author Administrator
 * @version 1.0
 * @date 2026/6/1 10:56
 */
@Service("shoppingFundsDetailService")
public class ShoppingFundsDetailServiceImpl extends ServiceImpl<ShoppingFundsDetailMapper, ShoppingFundsDetail> implements ShoppingFundsDetailService {

    @Resource
    private TWxUserService wxUserService;
    @Override
    public Page<ShoppingFundsDetailQueryVo> queryShoppingFundsDetail(ShoppingFundsDetailQueryDto shoppingFundsDetailQueryDto) {
        Page<ShoppingFundsDetailQueryVo> page = new Page<ShoppingFundsDetailQueryVo>(shoppingFundsDetailQueryDto.getPageNo(), shoppingFundsDetailQueryDto.getPageSize());
        return baseMapper.queryShoppingFundsDetail(shoppingFundsDetailQueryDto,page);
    }

    /**
     * 新增购物金明细
     * @param dto
     */
    @Override
    public void addShoppingFundsDetail(ShoppingFundsDetailAddDto dto) {
        ShoppingFundsDetail shoppingFundsDetail = new ShoppingFundsDetail();
        BeanUtils.copyProperties(dto, shoppingFundsDetail);
        baseMapper.insert(shoppingFundsDetail);
    }
}