|
@@ -95,10 +95,11 @@ public class PollutantAcceptController extends CommonController {
|
|
|
String paramJsonData = getParamJsonData(vo.getData());
|
|
|
PollutantWarningInfoReq pollutantWarningInfoReq = JSONObject.parseObject(paramJsonData,
|
|
|
PollutantWarningInfoReq.class);
|
|
|
- if (StringUtils.isBlank(pollutantWarningInfoReq.getBoatName()) && StringUtils.isBlank(
|
|
|
+
|
|
|
+
|
|
|
pollutantWarningInfoReq.getMmsi())) {
|
|
|
throw new EnumException("船名/MMSI 请至少输入一个查询参数");
|
|
|
- }
|
|
|
+ }*/
|
|
|
List<PollutanWarningInfoVo> voList = boatWaterPollutantAcceptFService.selectWarningInfoList(
|
|
|
pollutantWarningInfoReq);
|
|
|
ResultRes resultRes = ResultRes.encapsulationResult(pollutantWarningInfoReq.getPageIndex(),
|
|
@@ -132,6 +133,37 @@ public class PollutantAcceptController extends CommonController {
|
|
|
return ReturnMsg.success("获取成功", encodedData);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/getBoatWarnListByDate")
|
|
|
+ public ReturnMsg getBoatWarnListByDate(@RequestBody @Validated ObjectBodyVo vo)
|
|
|
+ throws ParseException {
|
|
|
+ if (!checkDbKey(vo.getKey())) {
|
|
|
+ return ReturnMsg.error(HttpStatus.BAD_REQUEST, "key值有误,请确认您输入的key值正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ String paramJsonData = getParamJsonData(vo.getData());
|
|
|
+ PollutantWarningInfoReq pollutantWarningInfoReq = JSONObject.parseObject(paramJsonData,
|
|
|
+ PollutantWarningInfoReq.class);
|
|
|
+
|
|
|
+ if(pollutantWarningInfoReq.getStartTime().isEmpty() || pollutantWarningInfoReq.getEndTime().isEmpty()){
|
|
|
+ throw new EnumException("startTime和endTime不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<String> datesBetween = PollutantBoatWaterReq.getDatesBetween(
|
|
|
+ pollutantWarningInfoReq.getStartTime(),
|
|
|
+ pollutantWarningInfoReq.getEndTime());
|
|
|
+ if (datesBetween.size() > 7) {
|
|
|
+ return ReturnMsg.warn("开始时间和结束时间的最大间隔为七天");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PollutanWarningInfoVo> pollutanWarningInfoVoList = boatWaterPollutantAcceptFService.selectWarningInfoListByDate(
|
|
|
+ pollutantWarningInfoReq);
|
|
|
+ ResultRes resultRes = ResultRes.encapsulationResult(pollutantWarningInfoReq.getPageIndex(),
|
|
|
+ pollutantWarningInfoReq.getPageSize(),
|
|
|
+ CommonTools.getTotal(pollutanWarningInfoVoList), pollutanWarningInfoVoList);
|
|
|
+ String jsonString = JSONObject.toJSONString(resultRes);
|
|
|
+ String encodedData = resultEncode(jsonString);
|
|
|
+ return ReturnMsg.success("获取成功", encodedData);
|
|
|
+ }
|
|
|
|
|
|
@PostMapping("/getBoatWaterListSync")
|
|
|
public ReturnMsg getBoatWaterListSync(@RequestBody @Validated ObjectBodyVo vo)
|