package com.ruoyi.dataInterchange.controller;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.utils.bean.BeanUtils;
|
import com.ruoyi.dataInterchange.api.vo.UPExgMsgReportDriverInfoVo;
|
import com.ruoyi.dataInterchange.dao.UPExgMsgReportDriverInfoAckDao;
|
import com.ruoyi.dataInterchange.model.UPExgMsgReportDriverInfoAck;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
import java.util.ArrayList;
|
import java.util.Iterator;
|
import java.util.List;
|
|
/**
|
* @author zhibing.pu
|
* @Date 2025/3/17 16:35
|
*/
|
@RestController
|
@RequestMapping("/UPExgMsgReportDriverInfo")
|
public class UPExgMsgReportDriverInfoController {
|
|
|
@Resource
|
private UPExgMsgReportDriverInfoAckDao upExgMsgReportDriverInfoAckDao;
|
|
|
/**
|
* 查询添加时间等于或大于给定时间的数据
|
*
|
* @param createTime
|
* @return
|
*/
|
@PostMapping("/getUPExgMsgReportDriverInfoListIsAfterCreateTime")
|
public R<List<UPExgMsgReportDriverInfoVo>> getUPExgMsgReportDriverInfoListIsAfterCreateTime(@RequestParam("createTime") Long createTime) {
|
List<UPExgMsgReportDriverInfoVo> voList = new ArrayList<>();
|
if (-1 == createTime) {
|
Iterator<UPExgMsgReportDriverInfoAck> iterator = upExgMsgReportDriverInfoAckDao.findAll().iterator();
|
while (iterator.hasNext()) {
|
UPExgMsgReportDriverInfoAck next = iterator.next();
|
UPExgMsgReportDriverInfoVo vo = new UPExgMsgReportDriverInfoVo();
|
BeanUtils.copyProperties(next, vo);
|
voList.add(vo);
|
}
|
} else {
|
List<UPExgMsgReportDriverInfoAck> list = upExgMsgReportDriverInfoAckDao.findByCreateTimeIsAfter(createTime);
|
for (UPExgMsgReportDriverInfoAck upExgMsgReportDriverInfoAck : list) {
|
UPExgMsgReportDriverInfoVo vo = new UPExgMsgReportDriverInfoVo();
|
BeanUtils.copyProperties(upExgMsgReportDriverInfoAck, vo);
|
voList.add(vo);
|
}
|
}
|
return R.ok(voList);
|
}
|
}
|