cdr insert date bug fixes
This commit is contained in:
parent
99762e6475
commit
5cbc91fe60
@ -3,6 +3,7 @@ package com.pudonghot.yo.model.domain;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.Date;
|
||||
import lombok.ToString;
|
||||
import com.wacai.tigon.model.M0;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.chyxion.tigon.mybatis.NotUpdate;
|
||||
@ -14,6 +15,7 @@ import lombok.experimental.FieldNameConstants;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@FieldNameConstants(prefix = "")
|
||||
public class CallDetailRecordBase extends M0<Integer> {
|
||||
@NotUpdate
|
||||
|
@ -5,8 +5,8 @@ import java.util.Date;
|
||||
import java.util.Calendar;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import com.pudonghot.yo.mapper.CallDetailRecordMapper;
|
||||
import com.pudonghot.yo.model.domain.CallDetailRecord;
|
||||
import com.pudonghot.yo.model.domain.CallDetailRecordAll;
|
||||
@ -39,7 +39,7 @@ public class CallDetailRecordServiceImpl
|
||||
|
||||
if (req.getDialType() == CallDetailRecordBase.DialType.CAMPAIGN) {
|
||||
val calledNumber = req.getCalledNumber();
|
||||
val today = DateUtils.truncate(new Date(), Calendar.HOUR);
|
||||
val today = DateUtils.truncate(new Date(), Calendar.DATE);
|
||||
val search = new Search(CallDetailRecord.CALLED_NUMBER, calledNumber)
|
||||
.between(CallDetailRecord.START_STAMP,
|
||||
DateUtils.addDays(today, -2),
|
||||
|
@ -27,8 +27,8 @@ public class TestDriver {
|
||||
public void testDate() {
|
||||
|
||||
log.info("Before Yesterday [{}].", DateUtils.addDays(
|
||||
DateUtils.truncate(new Date(), Calendar.HOUR), -2));
|
||||
DateUtils.truncate(new Date(), Calendar.DATE), -2));
|
||||
log.info("Yesterday [{}].", DateUtils.addDays(
|
||||
DateUtils.truncate(new Date(), Calendar.HOUR), -1));
|
||||
DateUtils.truncate(new Date(), Calendar.DATE), -1));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user