| | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voSt.*; |
| | | import com.dy.pipIrrStatistics.intake.qo.*; |
| | | import com.dy.pipIrrGlobal.voSt.VoBatteryVolt; |
| | | import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntake; |
| | | import com.dy.pipIrrGlobal.voSt.VoSignalIntensity; |
| | | import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount; |
| | | import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO; |
| | | import com.dy.pipIrrStatistics.intake.qo.IntakeQO; |
| | | import com.dy.pipIrrStatistics.intake.qo.SignalIntensityQO; |
| | | import com.dy.pipIrrStatistics.intake.qo.IntakeValueQO; |
| | | import com.dy.pipIrrStatistics.result.StatisticlResultCode; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | */ |
| | | @GetMapping(path = "/getNotOnlineIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getNotOnlineIntakes(IntakeQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getNotOnlineIntakes(@Valid CommonQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(intakeSv.getNotOnlineIntakes(qo)); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | @GetMapping(path = "/getLargeFlowIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getLargeFlowIntakes(CumulativeFlowQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getLargeFlowIntakes(@Valid CumulativeFlowQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(intakeSv.getLargeFlowIntakes(qo)); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | @GetMapping(path = "/getSmallFlowIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getSmallFlowIntakes(CumulativeFlowQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getSmallFlowIntakes(@Valid CumulativeFlowQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(intakeSv.getSmallFlowIntakes(qo)); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | @GetMapping(path = "/getUnderVoltIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoBatteryVolt>>> getUnderVoltIntakes(BatteryVoltQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoBatteryVolt>>> getUnderVoltIntakes(@Valid BatteryVoltQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(intakeSv.getUnderVoltIntakes(qo)); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | @GetMapping(path = "/getSpecifiedSignalIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoSignalIntensity>>> getSpecifiedSignalIntakes(SignalIntensityQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoSignalIntensity>>> getSpecifiedSignalIntakes(@Valid SignalIntensityQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(intakeSv.getSpecifiedSignalIntakes(qo)); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | @GetMapping(path = "/getCountByOpenType") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<VoCountOfOpenType>> getCountByOpenType(OpenTypeQO qo) { |
| | | public BaseResponse<QueryResultVo<VoCountOfOpenType>> getCountByOpenType(@Valid OpenTypeQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(intakeSv.getCountByOpenType(qo)); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | @GetMapping(path = "/getCountByCloseType") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<VoCountOfCloseType>> getCountByCloseType(CloseTypeQo qo) { |
| | | public BaseResponse<QueryResultVo<VoCountOfCloseType>> getCountByCloseType(@Valid CloseTypeQo qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(intakeSv.getCountByCloseType(qo)); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | @GetMapping(path = "/getNeverOpenValveIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(IntakeQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(CommonQO qo) { |
| | | try { |
| | | QueryResultVo<List<VoIntake>> res = intakeSv.getNeverOpenValveIntakes(qo); |
| | | if(res.itemTotal == 0) { |