添加和实现发送航班计划同步请求

This commit is contained in:
zhouxiunai
2018-12-19 14:29:43 +08:00
parent 653c1c554a
commit fae61468e5
2 changed files with 66 additions and 0 deletions
@@ -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;
}
}