添加和实现发送航班计划同步请求
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package com.gzzn.omms.msgexchangeapi.controller;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.dto.ResponseDto;
|
||||
import com.gzzn.omms.msgexchangeapi.dto.SchdSyncDto;
|
||||
import com.gzzn.omms.msgexchangeapi.service.ICmoutmsgService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.DateTimeUtil;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/schd")
|
||||
public class SchdController {
|
||||
|
||||
@Autowired
|
||||
ICmoutmsgService cmoutmsgService;
|
||||
|
||||
@PostMapping("/sync")
|
||||
public ResponseDto sync(@RequestBody SchdSyncDto schdSyncDto)
|
||||
{
|
||||
Date startDate=null;
|
||||
Date endDate=null;
|
||||
|
||||
if(!StringUtils.isEmpty(schdSyncDto.getStartDate()))
|
||||
{
|
||||
startDate = DateTimeUtil.toDate(schdSyncDto.getStartDate()
|
||||
, "yyyy-MM-dd hh:mm");
|
||||
}
|
||||
if(!StringUtils.isEmpty(schdSyncDto.getEndDate()))
|
||||
{
|
||||
endDate = DateTimeUtil.toDate(schdSyncDto.getEndDate()
|
||||
, "yyyy-MM-dd hh:mm");
|
||||
}
|
||||
|
||||
cmoutmsgService.sendSchdGetMsg(startDate, endDate);
|
||||
|
||||
return ResponseDto.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.gzzn.omms.msgexchangeapi.dto;
|
||||
|
||||
|
||||
public class SchdSyncDto {
|
||||
private String startDate;//格式,yyyy-MM-dd hh:mm
|
||||
private String endDate;//格式,yyyy-MM-dd hh:mm
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user