TpPTgsPassedcarServiceImpl.java 2 KB
package com.zteits.park.biz;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.zteits.clouds.api.apibase.bean.BizResult;
import com.zteits.clouds.api.apibase.bean.PageBean;
import com.zteits.clouds.api.apibase.constants.ErrorType;
import com.zteits.clouds.api.apibase.exception.BizException;
import com.zteits.clouds.api.dto.park.dto.TpPTgsPassedcarDTO;
import com.zteits.clouds.api.dto.park.param.TpPTgsPassedcarRequest;
import com.zteits.clouds.api.service.park.TpPTgsPassedcarService;
import com.zteits.park.biz.eqp.oper.TpPPdaOperServiceImpl;
import com.zteits.park.dao.TpPTgsPassedcardaDao;
import com.zteits.park.domain.TpPTgsPassedcar;
import com.zteits.park.pagepager.PageBeanUtil;
import org.springframework.stereotype.Service;

@Service("com.zteits.park.biz.TpPTgsPassedcarServiceImpl")
public class TpPTgsPassedcarServiceImpl implements TpPTgsPassedcarService {

	 private static final Logger logger = LoggerFactory.getLogger(TpPPdaOperServiceImpl.class);
	
	 @Autowired
	private TpPTgsPassedcardaDao tpPTgsPassedcardaDao;
	 
	@Override
	public BizResult<PageBean<TpPTgsPassedcarDTO>> queryPassedcar4Page(TpPTgsPassedcarRequest request) {
		PageBean<TpPTgsPassedcarDTO> pageBean = new PageBean<TpPTgsPassedcarDTO>();
        if (request == null) {
            throw new BizException(ErrorType.PARAMM_NULL, "入参不能为空!");
        }
        PageInfo<TpPTgsPassedcar> pageInfo = tpPTgsPassedcardaDao.queryTpPRegionAreaForPage(request);
        if (pageInfo != null && pageInfo.getList() != null && pageInfo.getList().size() > 0) {
            PageBeanUtil.copyProperties(pageInfo, pageBean, TpPTgsPassedcarDTO.class);
        } else {
            logger.info("没有查询到过车信息...");
        }
        logger.info("---end-过车分页查询,结果={}", JSONObject.toJSON(pageBean));

        return new BizResult<PageBean<TpPTgsPassedcarDTO>>(pageBean);
	}

}