| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeIssueReport; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeReportReply; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReport; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReportReply; |
| | | import com.dy.pipIrrWechat.issue.dto.DtoIssueReport; |
| | | import com.dy.pipIrrWechat.issue.dto.DtoReportReply; |
| | | import com.dy.pipIrrWechat.issue.qo.QoIssueReport; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 回复农户问题上报 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "replyReport") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BaseResponse<Boolean> replyReport(@RequestBody @Valid DtoReportReply po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | SeReportReply seReportReply = new SeReportReply(); |
| | | seReportReply.setReportId(po.getReportId()); |
| | | seReportReply.setReplyContent(po.getReplyContent()); |
| | | seReportReply.setReplyTime(new Date()); |
| | | seReportReply.setReplierId(po.getReplierId()); |
| | | Long reportReplyId = issueSv.insertReportReply(seReportReply); |
| | | if(reportReplyId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("回复农户问题上报失败"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 根据问题上报ID获取上报回复信息 |
| | | * @param reportId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getReportReply") |
| | | public BaseResponse<VoIssueReportReply> getReportReply(@RequestParam("reportId") Long reportId) { |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(issueSv.getReportReplyByReportId(reportId)); |
| | | } catch (Exception e) { |
| | | log.error("获取上报回复信息录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |