|
@ -5,13 +5,22 @@ import awesome.group.game.dao.bean.MatrixApp; |
|
|
import awesome.group.game.dao.mapper.MatrixAdvRecordMapper; |
|
|
import awesome.group.game.dao.mapper.MatrixAdvRecordMapper; |
|
|
import awesome.group.game.dao.mapper.MatrixAppMapper; |
|
|
import awesome.group.game.dao.mapper.MatrixAppMapper; |
|
|
import awesome.group.game.service.bo.MatrixAdvRecordEditBo; |
|
|
import awesome.group.game.service.bo.MatrixAdvRecordEditBo; |
|
|
|
|
|
import awesome.group.game.service.bo.MatrixAdvRecordSimple; |
|
|
import awesome.group.game.service.common.log.L; |
|
|
import awesome.group.game.service.common.log.L; |
|
|
import awesome.group.game.service.util.EncryptUtil; |
|
|
import awesome.group.game.service.util.EncryptUtil; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import jakarta.annotation.Resource; |
|
|
import jakarta.annotation.Resource; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.util.Assert; |
|
|
import org.springframework.util.Assert; |
|
|
import org.springframework.util.StringUtils; |
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.sql.Timestamp; |
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
import java.time.YearMonth; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
public class MatrixService { |
|
|
public class MatrixService { |
|
|
|
|
|
|
|
@ -64,6 +73,27 @@ public class MatrixService { |
|
|
saveRecord(bo, ip); |
|
|
saveRecord(bo, ip); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<MatrixAdvRecordSimple> getAdvList(String appCode, String deviceId) { |
|
|
|
|
|
MatrixApp app = mapper.queryApp(appCode); |
|
|
|
|
|
if (app == null) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
|
|
YearMonth thisMonth = YearMonth.from(now); |
|
|
|
|
|
|
|
|
|
|
|
// 获取本月的第一天
|
|
|
|
|
|
LocalDate firstDayOfThisMonth = thisMonth.atDay(1); |
|
|
|
|
|
LocalDateTime localDateTime = firstDayOfThisMonth.atStartOfDay(); |
|
|
|
|
|
Timestamp timestamp = Timestamp.valueOf(localDateTime); |
|
|
|
|
|
LambdaQueryWrapper<MatrixAdvRecord> advQuery = new QueryWrapper<MatrixAdvRecord>().lambda(); |
|
|
|
|
|
advQuery.gt(MatrixAdvRecord::getCreatedAt, timestamp); |
|
|
|
|
|
advQuery.eq(MatrixAdvRecord::getDeviceId, deviceId); |
|
|
|
|
|
advQuery.eq(MatrixAdvRecord::getAppId, app.getId()); |
|
|
|
|
|
advQuery.eq(MatrixAdvRecord::getAdvType, 3); |
|
|
|
|
|
List<MatrixAdvRecord> data = mapper.selectList(advQuery); |
|
|
|
|
|
return data.stream().map(MatrixAdvRecordSimple::new).toList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public boolean whiteList(String deviceId, String appCode) { |
|
|
public boolean whiteList(String deviceId, String appCode) { |
|
|
MatrixApp app = appMapper.queryByCode(appCode); |
|
|
MatrixApp app = appMapper.queryByCode(appCode); |
|
|
if (app == null) { |
|
|
if (app == null) { |
|
|