TpPInterfaceLogDaoImpl.java
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;
}
}