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.UPExgMsgRegisterVo;
|
import com.ruoyi.dataInterchange.dao.UPExgMsgRegisterDao;
|
import com.ruoyi.dataInterchange.model.UPExgMsgRegister;
|
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 13:39
|
*/
|
@RestController
|
@RequestMapping("/UPExgMsgRegister")
|
public class UPExgMsgRegisterController {
|
|
@Resource
|
private UPExgMsgRegisterDao upExgMsgRegisterDao;
|
|
|
/**
|
* 查询添加时间大于等于给定时间的车辆基础数据
|
*
|
* @param startTime
|
* @return
|
*/
|
@PostMapping("/getUPExgMsgRegisterListIsAfterCreateTime")
|
public R<List<UPExgMsgRegisterVo>> getUPExgMsgRegisterListIsAfterCreateTime(@RequestParam("startTime") Long startTime) {
|
List<UPExgMsgRegisterVo> voList = new ArrayList<>();
|
if (-1 == startTime) {
|
Iterator<UPExgMsgRegister> iterator = upExgMsgRegisterDao.findAll().iterator();
|
while (iterator.hasNext()) {
|
UPExgMsgRegister register = iterator.next();
|
UPExgMsgRegisterVo vo = new UPExgMsgRegisterVo();
|
BeanUtils.copyProperties(register, vo);
|
voList.add(vo);
|
}
|
|
} else {
|
List<UPExgMsgRegister> list = upExgMsgRegisterDao.findByCreateTimeIsAfter(startTime);
|
for (UPExgMsgRegister register : list) {
|
UPExgMsgRegisterVo vo = new UPExgMsgRegisterVo();
|
BeanUtils.copyProperties(register, vo);
|
voList.add(vo);
|
}
|
}
|
return R.ok(voList);
|
}
|
}
|