| | |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"issueReportId", "clientName", "phone", "reportTime", "content", "images", "audios", "videos", "stateId", "state"}) |
| | | @JsonPropertyOrder({"issueReportId", "clientName", "phone", "reportTime", "content", "images", "audios", "videos", "replyTime", "stateId", "state"}) |
| | | public class VoIssueReport implements BaseEntity { |
| | | private static final long serialVersionUID = 202410301354001L; |
| | | |
| | |
| | | private String videos; |
| | | |
| | | /** |
| | | * 上报回复时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date replyTime; |
| | | |
| | | /** |
| | | * 状态值 |
| | | */ |
| | | private Integer stateId; |
| | |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM se_issue_report rpt |
| | | LEFT JOIN se_client cli ON cli.id = rpt.client_id |
| | | LEFT JOIN se_report_reply rpy ON rpy.report_id = rpt.id |
| | | <where> |
| | | AND rpt.state != 3 |
| | | |
| | |
| | | rpt.images, |
| | | rpt.audios, |
| | | rpt.videos, |
| | | rpy.reply_time AS replyTime, |
| | | rpt.state AS stateId, |
| | | CASE |
| | | WHEN rpt.state = 1 THEN '未受理' |
| | |
| | | END AS state |
| | | FROM se_issue_report rpt |
| | | LEFT JOIN se_client cli ON cli.id = rpt.client_id |
| | | LEFT JOIN se_report_reply rpy ON rpy.report_id = rpt.id |
| | | <where> |
| | | AND rpt.state != 3 |
| | | |
| | |
| | | } |
| | | |
| | | try { |
| | | //取水口ID |
| | | Integer recordCount = Optional.ofNullable(issueSv.deleteIssueReport(issueReportId)).orElse(0); |
| | | if (recordCount == 0) { |
| | | return BaseResponseUtils.buildErrorMsg("农户问题上报删除失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | }else { |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("农户问题上报删除失败", e); |
| | |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 添加上报回复记录 |
| | | SeReportReply seReportReply = new SeReportReply(); |
| | | seReportReply.setReportId(po.getReportId()); |
| | | seReportReply.setReplyContent(po.getReplyContent()); |
| | |
| | | Long reportReplyId = issueSv.insertReportReply(seReportReply); |
| | | if(reportReplyId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("回复农户问题上报失败"); |
| | | } |
| | | |
| | | // 修改问题上报状态为已回复 |
| | | SeIssueReport seIssueReport = new SeIssueReport(); |
| | | seIssueReport.setId(po.getReportId()); |
| | | seIssueReport.setState((byte)2); |
| | | Integer issueReportId = issueSv.updateIssueReport(seIssueReport); |
| | | if(issueReportId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("农户问题上报修改失败"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | |
| | | */ |
| | | @GetMapping(path = "/getReportReply") |
| | | public BaseResponse<VoIssueReportReply> getReportReply(@RequestParam("reportId") Long reportId) { |
| | | if(reportId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("请选择一个问题上报"); |
| | | } |
| | | |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(issueSv.getReportReplyByReportId(reportId)); |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改农户问题上报状态,回复及删除时使用 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer updateIssueReport(SeIssueReport po) { |
| | | return seIssueReportMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取农户问题上报 |
| | | * @param queryVo |
| | | * @return |