重构获取巡检员问题上报接口,重构获取农户问题上报接口
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeIssueReport; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReport; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReport_temp; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIssueReport> getIssueReports(Map<?, ?> params); |
| | | List<VoIssueReport_temp> getIssueReports(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据上报ID及巡检员ID获取未删除的上报,删除上报判断使用 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeIssueReport; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReport; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReport_temp; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIssueReport> getIssueReports(Map<?, ?> params); |
| | | List<VoIssueReport_temp> getIssueReports(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据上报ID及农户ID获取未删除的上报,删除上报判断使用 |
| | |
| | | package com.dy.pipIrrGlobal.voOp; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-12 14:46 |
| | | * @LastEditTime 2024-11-12 14:46 |
| | | * @date 2024-12-03 15:02 |
| | | * @LastEditTime 2024-12-03 15:02 |
| | | * @Description 巡检员问题上报视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"issueReportId", "inspectorName", "phone", "reportTime", "content", "images", "audios", "videos", "replyTime", "stateId", "state"}) |
| | | public class VoIssueReport implements BaseEntity { |
| | | private static final long serialVersionUID = 202411121448001L; |
| | | private static final long serialVersionUID = 202412031504001L; |
| | | |
| | | /** |
| | | * 巡检员问题上报ID |
| | |
| | | /** |
| | | * 照片列表 |
| | | */ |
| | | private String images; |
| | | private JSONArray images; |
| | | |
| | | /** |
| | | * 音频列表 |
| | | */ |
| | | private String audios; |
| | | private JSONArray audios; |
| | | |
| | | /** |
| | | * 视频列表 |
| | | */ |
| | | private String videos; |
| | | private JSONArray videos; |
| | | |
| | | /** |
| | | * 上报回复时间 |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voOp; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-12 14:46 |
| | | * @LastEditTime 2024-11-12 14:46 |
| | | * @Description 巡检员问题上报临时视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"issueReportId", "inspectorName", "phone", "reportTime", "content", "images", "audios", "videos", "replyTime", "stateId", "state"}) |
| | | public class VoIssueReport_temp implements BaseEntity { |
| | | private static final long serialVersionUID = 202411121448001L; |
| | | |
| | | /** |
| | | * 巡检员问题上报ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long issueReportId; |
| | | |
| | | /** |
| | | * 巡检员姓名 |
| | | */ |
| | | private String inspectorName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 上报时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reportTime; |
| | | |
| | | /** |
| | | * 上报内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 照片列表 |
| | | */ |
| | | private String images; |
| | | |
| | | /** |
| | | * 音频列表 |
| | | */ |
| | | private String audios; |
| | | |
| | | /** |
| | | * 视频列表 |
| | | */ |
| | | private String videos; |
| | | |
| | | /** |
| | | * 上报回复时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date replyTime; |
| | | |
| | | /** |
| | | * 状态值 |
| | | */ |
| | | private Integer stateId; |
| | | |
| | | /** |
| | | * 状态描述 |
| | | */ |
| | | private String state; |
| | | } |
| | |
| | | @Data |
| | | @JsonPropertyOrder({"proResultId","workOrderId","inspector","content"," images"," audios"," videos","lng","lat","completeTime","reportTime","state","stateName"}) |
| | | public class VoProcessingResult implements BaseEntity { |
| | | public static final long serialVersionUID = 202411081500001L; |
| | | public static final long serialVersionUID = 202412031505001L; |
| | | |
| | | /** |
| | | * 处理结果ID |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-10-30 13:51 |
| | | * @LastEditTime 2024-10-30 13:51 |
| | | * @date 2024-12-03 15:56 |
| | | * @LastEditTime 2024-12-03 15:56 |
| | | * @Description 农户问题上报视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"issueReportId", "clientName", "phone", "reportTime", "content", "images", "audios", "videos", "replyTime", "stateId", "state"}) |
| | | public class VoIssueReport implements BaseEntity { |
| | | private static final long serialVersionUID = 202410301354001L; |
| | | private static final long serialVersionUID = 202412031557001L; |
| | | |
| | | /** |
| | | * 农户问题上报ID |
| | |
| | | /** |
| | | * 照片列表 |
| | | */ |
| | | private String images; |
| | | private JSONArray images; |
| | | |
| | | /** |
| | | * 音频列表 |
| | | */ |
| | | private String audios; |
| | | private JSONArray audios; |
| | | |
| | | /** |
| | | * 视频列表 |
| | | */ |
| | | private String videos; |
| | | private JSONArray videos; |
| | | |
| | | /** |
| | | * 上报回复时间 |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-10-30 13:51 |
| | | * @LastEditTime 2024-10-30 13:51 |
| | | * @Description 农户问题上报临时视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"issueReportId", "clientName", "phone", "reportTime", "content", "images", "audios", "videos", "replyTime", "stateId", "state"}) |
| | | public class VoIssueReport_temp implements BaseEntity { |
| | | private static final long serialVersionUID = 202410301354001L; |
| | | |
| | | /** |
| | | * 农户问题上报ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long issueReportId; |
| | | |
| | | /** |
| | | * 农户姓名 |
| | | */ |
| | | private String clientName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 上报时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reportTime; |
| | | |
| | | /** |
| | | * 上报内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 照片列表 |
| | | */ |
| | | private String images; |
| | | |
| | | /** |
| | | * 音频列表 |
| | | */ |
| | | private String audios; |
| | | |
| | | /** |
| | | * 视频列表 |
| | | */ |
| | | private String videos; |
| | | |
| | | /** |
| | | * 上报回复时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date replyTime; |
| | | |
| | | /** |
| | | * 状态值 |
| | | */ |
| | | private Integer stateId; |
| | | |
| | | /** |
| | | * 状态描述 |
| | | */ |
| | | private String state; |
| | | } |
| | |
| | | </select> |
| | | |
| | | <!--根据指定条件获取巡检员问题上报--> |
| | | <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voOp.VoIssueReport"> |
| | | <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voOp.VoIssueReport_temp"> |
| | | SELECT |
| | | rpt.id AS issueReportId, |
| | | us.name AS inspectorName, |
| | |
| | | </select> |
| | | |
| | | <!--根据指定条件获取农户问题上报--> |
| | | <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voSe.VoIssueReport" > |
| | | <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voSe.VoIssueReport_temp" > |
| | | SELECT |
| | | rpt.id AS issueReportId, |
| | | cli.name AS clientName, |
| | |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeInspect; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeTrack; |
| | | import com.dy.pipIrrGlobal.voOp.VoInspect; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReport; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIssueReport>>> getIssueReports(QoIssueReport vo) { |
| | | try { |
| | | QueryResultVo<List<VoIssueReport>> res = issueSv.getIssueReports(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | //QueryResultVo<List<VoIssueReport_temp>> res = issueSv.getIssueReports(vo); |
| | | return BaseResponseUtils.buildSuccess(issueSv.getIssueReports(vo)); |
| | | } catch (Exception e) { |
| | | log.error("获取巡检员问题上报记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | |
| | | package com.dy.pipIrrApp.issue; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeReportReply; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReport; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReportReply; |
| | | import com.dy.pipIrrGlobal.voOp.VoIssueReport_temp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = opeIssueReportMapper.getIssueReportsCount(params); |
| | | //QueryResultVo<List<VoIssueReport_temp>> rsVo = new QueryResultVo<>(); |
| | | QueryResultVo<List<VoIssueReport>> rsVo = new QueryResultVo<>(); |
| | | |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = opeIssueReportMapper.getIssueReports(params); |
| | | |
| | | List<VoIssueReport_temp> list_temp = opeIssueReportMapper.getIssueReports(params); |
| | | List<VoIssueReport> list = new ArrayList<>(); |
| | | for (int i = 0; i < list_temp.size(); i++) { |
| | | VoIssueReport_temp report_temp = list_temp.get(i); |
| | | VoIssueReport report = new VoIssueReport(); |
| | | BeanUtils.copyProperties(report_temp, report); |
| | | |
| | | JSONArray images_array = Optional.ofNullable(JSON.parseArray(report_temp.getImages())).orElse(new JSONArray()); |
| | | JSONArray audios_array = Optional.ofNullable(JSON.parseArray(report_temp.getAudios())).orElse(new JSONArray()); |
| | | JSONArray videos_array = Optional.ofNullable(JSON.parseArray(report_temp.getVideos())).orElse(new JSONArray()); |
| | | report.setImages(images_array); |
| | | report.setAudios(audios_array); |
| | | report.setVideos(videos_array); |
| | | list.add(report); |
| | | } |
| | | |
| | | rsVo.obj = list; |
| | | //rsVo.obj = opeIssueReportMapper.getIssueReports(params); |
| | | return rsVo; |
| | | } |
| | | |
| | |
| | | @GetMapping(path = "/getIssueReports") |
| | | public BaseResponse<QueryResultVo<List<VoIssueReport>>> getIssueReports(QoIssueReport vo) { |
| | | try { |
| | | QueryResultVo<List<VoIssueReport>> res = issueSv.getIssueReports(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | //QueryResultVo<List<VoIssueReport_temp>> res = issueSv.getIssueReports(vo); |
| | | return BaseResponseUtils.buildSuccess(issueSv.getIssueReports(vo)); |
| | | } catch (Exception e) { |
| | | log.error("获取农户问题上报记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | |
| | | package com.dy.pipIrrWechat.issue; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeIssueReportMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeReportReplyMapper; |
| | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeReportReply; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReport; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReportReply; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReport_temp; |
| | | import com.dy.pipIrrWechat.issue.qo.QoIssueReport; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seIssueReportMapper.getIssueReports(params); |
| | | |
| | | List<VoIssueReport_temp> list_temp = seIssueReportMapper.getIssueReports(params); |
| | | List<VoIssueReport> list = new ArrayList<>(); |
| | | for (int i = 0; i < list_temp.size(); i++) { |
| | | VoIssueReport_temp report_temp = list_temp.get(i); |
| | | VoIssueReport report = new VoIssueReport(); |
| | | BeanUtils.copyProperties(report_temp, report); |
| | | |
| | | JSONArray images_array = Optional.ofNullable(JSON.parseArray(report_temp.getImages())).orElse(new JSONArray()); |
| | | JSONArray audios_array = Optional.ofNullable(JSON.parseArray(report_temp.getAudios())).orElse(new JSONArray()); |
| | | JSONArray videos_array = Optional.ofNullable(JSON.parseArray(report_temp.getVideos())).orElse(new JSONArray()); |
| | | report.setImages(images_array); |
| | | report.setAudios(audios_array); |
| | | report.setVideos(videos_array); |
| | | list.add(report); |
| | | } |
| | | |
| | | rsVo.obj = list; |
| | | return rsVo; |
| | | } |
| | | |