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.UPExgMsgTakeEwayBillAckVo;
|
import com.ruoyi.dataInterchange.dao.UPExgMsgTakeEwayBillAckDao;
|
import com.ruoyi.dataInterchange.model.UPExgMsgTakeEwayBillAck;
|
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/4/2 11:36
|
*/
|
@RestController
|
@RequestMapping("/exgMsgTakeEwayBillAck")
|
public class UPExgMsgTakeEwayBillAckController {
|
|
@Resource
|
private UPExgMsgTakeEwayBillAckDao upExgMsgTakeEwayBillAckDao;
|
|
|
/**
|
* 获取大于给定日期的数据
|
*
|
* @param createTime
|
* @return
|
*/
|
@PostMapping("/findByCreateTimeAfter")
|
public R<List<UPExgMsgTakeEwayBillAckVo>> findByCreateTimeAfter(@RequestParam("createTime") Long createTime) {
|
List<UPExgMsgTakeEwayBillAckVo> list = new ArrayList<>();
|
if (-1 == createTime) {
|
Iterator<UPExgMsgTakeEwayBillAck> iterator = upExgMsgTakeEwayBillAckDao.findAll().iterator();
|
if (iterator.hasNext()) {
|
UPExgMsgTakeEwayBillAck takeEwayBillAck = iterator.next();
|
UPExgMsgTakeEwayBillAckVo vo = new UPExgMsgTakeEwayBillAckVo();
|
BeanUtils.copyProperties(takeEwayBillAck, vo);
|
list.add(vo);
|
}
|
} else {
|
List<UPExgMsgTakeEwayBillAck> takeEwayBillAcks = upExgMsgTakeEwayBillAckDao.findByCreateTimeAfter(createTime);
|
for (UPExgMsgTakeEwayBillAck takeEwayBillAck : takeEwayBillAcks) {
|
UPExgMsgTakeEwayBillAckVo vo = new UPExgMsgTakeEwayBillAckVo();
|
BeanUtils.copyProperties(takeEwayBillAck, vo);
|
list.add(vo);
|
}
|
}
|
return R.ok(list);
|
}
|
|
}
|