|
@@ -162,6 +162,32 @@ public class StationRemindApiController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "更新订阅报站数量")
|
|
|
+ @PostMapping("updateStationNum")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id", value = "订阅编号", paramType = "form"),
|
|
|
+ @ApiImplicitParam(name = "num", value = "提前站数量", paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<StationRemind> updateStationNum(String id, String num) {
|
|
|
+ MessageResult<StationRemind> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ StationRemind stationRemind = stationRemindService.get(id);
|
|
|
+ stationRemind.setStopInAdvance(Integer.parseInt(num));
|
|
|
+ stationRemindService.update(stationRemind);
|
|
|
+ msgResult.setData(stationRemind);
|
|
|
+ msgResult.setCode(200);
|
|
|
+ msgResult.setResult(true);
|
|
|
+ } catch (Exception ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
private StationInfo getAdvanceStation(String startStationId, String remindStationId, Integer stopInAdvance) throws Exception {
|
|
|
StationInfo station = stationInfoService.get(remindStationId);
|
|
|
|