TpPInterfaceLogDaoImpl.java 1.35 KB
package com.zteits.park.dao.impl;

import com.clouds.common.constants.ParkConstant;
import com.zteits.park.dao.TpPInterfaceLogDao;
import com.zteits.park.domain.TpPExceptionLogWithBLOBs;
import com.zteits.park.domain.TpPInterfaceLogWithBLOBs;
import com.zteits.park.mapper.TpPExceptionLogMapper;
import com.zteits.park.mapper.TpPInterfaceLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class TpPInterfaceLogDaoImpl implements TpPInterfaceLogDao {

	@Autowired
	private TpPExceptionLogMapper pExceptionLogMapper;
	@Autowired
	private TpPInterfaceLogMapper tpPInterfaceLogMapper;
	@Override
	public Boolean saveExceptionLog(TpPExceptionLogWithBLOBs record) {
		if(record.getCreateTime()==null){
			record.setCreateTime(new Date());
		}
		if(record.getDealStatus()==null){
			record.setDealStatus(ParkConstant.DealState.WAIT_DEAL);
		}
		return pExceptionLogMapper.insertSelective(record)>0;
	}
	@Override
	public Boolean saveSuccessLog(TpPInterfaceLogWithBLOBs record) {
		if(record.getCreateTime()==null){
			record.setCreateTime(new Date());
		}
		if(record.getDealStatus()==null){
			record.setDealStatus(ParkConstant.DealState.WAIT_DEAL);
		}
		if(record.getTryNum()==null){
			record.setTryNum(0);
		}
		return tpPInterfaceLogMapper.insertSelective(record)>0;
	}

}