package com.zjrs.zwnw.psam.bpo.impl;

import org.mohrss.leaf.core.framework.domain.bpo.impl.BPOImpl;
import org.mohrss.leaf.core.framework.persistens.PageResult;
import org.mohrss.leaf.core.framework.web.controller.AjaxResponse;
import com.zjrs.zwnw.psam.blo.PsamAzjgwhBLO;
import com.zjrs.zwnw.psam.bpo.PsamAzjgwhBPO;
import com.zjrs.zwnw.psam.dto.PsamAzjgDTO;
import com.zjrs.zwnw.psam.dto.PsamAzjgwhDTO;
import com.zjrs.zwnw.psam.dto.PsamQueryFjDTO;
import com.zjrs.zwnw.psam.po.RsPsamAzjgxxPO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;

/**
 *
 * @author liangxiudong
 * @since 2021-04-07
 */
@Service
public class PsamAzjgwhBPOImpl extends BPOImpl implements PsamAzjgwhBPO {
  @Resource
  private PsamAzjgwhBLO psamAzjgwhBLO;

  @Override
  public PageResult getList(PsamAzjgDTO dto, int page, int rows) {
    return this.psamAzjgwhBLO.getList(dto, page, rows);
  }

  @Override
  public AjaxResponse getInfo(PsamQueryFjDTO dto) {
    AjaxResponse ajaxResponse = new AjaxResponse();
    RsPsamAzjgxxPO rsPsamAzjgxxPO=this.psamAzjgwhBLO.getInfo(dto);
    ajaxResponse.setData("data",rsPsamAzjgxxPO);
    return ajaxResponse;
  }

  @Override
  public AjaxResponse saveData(PsamAzjgwhDTO dto) {
    AjaxResponse ajaxResponse = new AjaxResponse();
    RsPsamAzjgxxPO rsPsamAzjgxxPO=new RsPsamAzjgxxPO();
    BeanUtils.copyProperties(dto, rsPsamAzjgxxPO);
    this.psamAzjgwhBLO.saveData(rsPsamAzjgxxPO);
    return ajaxResponse;
  }
}
