| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrApp.issue.dto.DtoDeleteParam; |
| | | import com.dy.pipIrrApp.issue.qo.QoIssueReport; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeIssueReport; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeReportReply; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReport; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | 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 org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 获取巡检员问题上报记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getIssueReports") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIssueReport>>> getIssueReports(QoIssueReport vo) { |
| | | try { |
| | | QueryResultVo<List<VoIssueReport>> res = issueSv.getIssueReports(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取巡检员问题上报记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除巡检员问题上报,删除前先判断要删除的上报是否存在 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "deleteIssueReport") |
| | | public BaseResponse<Boolean> deleteIssueReport(@RequestBody @Valid DtoDeleteParam po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | String result = issueSv.deleteIssueReport(po); |
| | | if(!result.equals("success")) { |
| | | return BaseResponseUtils.buildErrorMsg(result); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 回复巡检员问题上报 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "replyReport") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BaseResponse<Boolean> replyReport(@RequestBody @Valid OpeReportReply po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | String result = issueSv.replyReport(po); |
| | | if(!result.equals("sucess")) { |
| | | return BaseResponseUtils.buildErrorMsg(result); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess() ; |
| | | } |
| | | |
| | | |
| | | } |