Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:49 |
| | | * @LastEditTime 2024-11-06 11:49 |
| | | * @date 2024-11-11 9:32 |
| | | * @LastEditTime 2024-11-11 9:32 |
| | | * @Description |
| | | */ |
| | | |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoOp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeIssueReport; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-11 16:18 |
| | | * @LastEditTime 2024-11-11 16:18 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface OpeIssueReportMapper extends BaseMapper<OpeIssueReport> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(OpeIssueReport record); |
| | | |
| | | int insertSelective(OpeIssueReport record); |
| | | |
| | | OpeIssueReport selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(OpeIssueReport record); |
| | | |
| | | int updateByPrimaryKey(OpeIssueReport record); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult; |
| | | import com.dy.pipIrrGlobal.voOp.VoProcessingResult; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | int updateByPrimaryKey(OpeProcessingResult record); |
| | | |
| | | /** |
| | | * 根据workOrderId获取未删除的处理结果数量,添加结果上报前判断使用 |
| | | * 根据工单ID获取未删除的工单对象 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | Integer getValidResultCount(Long workOrderId); |
| | | OpeProcessingResult getByWorkOrderId(Long workOrderId); |
| | | |
| | | /** |
| | | * 获取指定巡检员的指定未删除且未审批的处理结果上报,删除处理结果前判断使用使用 |
| | | * @param proResultId |
| | | * @param inspectorId |
| | | * @return |
| | | */ |
| | | OpeProcessingResult getProResult(@Param("proResultId")Long proResultId, @Param("inspectorId")Long inspectorId); |
| | | |
| | | /** |
| | | * 逻辑删除一个未删除的处理结果记录 |
| | | * @param proResultId |
| | | * @return |
| | | */ |
| | | Integer deleteProResult(Long proResultId); |
| | | |
| | | /** |
| | | * 根据主键获取处理结果视图对象 |
| | | * @param proResultId |
| | | * @return |
| | | */ |
| | | VoProcessingResult getProResultById(Long proResultId); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取指定派单人的指定未删除工单,删除工单前判断使用使用 |
| | | * @param dispatcherId |
| | | * @param workOrderId |
| | | * @param dispatcherId |
| | | * @return |
| | | */ |
| | | OpeWorkOrder getWorkOrder(@Param("dispatcherId")Long dispatcherId, @Param("workOrderId")Long workOrderId); |
| | | OpeWorkOrder getWorkOrder(@Param("workOrderId")Long workOrderId, @Param("dispatcherId")Long dispatcherId); |
| | | |
| | | /** |
| | | * 逻辑删除一个未删除的工单 |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.Max; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:49 |
| | | * @LastEditTime 2024-11-06 11:49 |
| | | * @date 2024-11-11 9:32 |
| | | * @LastEditTime 2024-11-11 9:32 |
| | | * @Description 处理结果审核实体类 |
| | | */ |
| | | |
| | | @TableName(value="ope_approve_result", autoResultMap = true) |
| | | @TableName(value = "ope_approve_result", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class OpeApproveResult implements BaseEntity { |
| | | public static final long serialVersionUID = 202411061152001L; |
| | | public static final long serialVersionUID = 202411110935001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工单ID |
| | | */ |
| | | * 工单ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull(message = "工单ID不能为空") |
| | | private Long workOrderId; |
| | | |
| | | /** |
| | | * 处理结果ID |
| | | */ |
| | | * 处理结果ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull(message = "处理结果不能为空") |
| | | private Long processingResultId; |
| | | |
| | | /** |
| | | * 审核人ID |
| | | */ |
| | | * 审核人ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull(message = "审核人不能为空") |
| | | private Long approverId; |
| | | |
| | | /** |
| | | * 审核时间 |
| | | */ |
| | | * 审核时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date approveTime; |
| | | |
| | | /** |
| | | * 审核结果;1-通过,2-驳回 |
| | | */ |
| | | * 审核结果;1-通过,2-驳回 |
| | | */ |
| | | @NotNull(message = "审核结果不能为空") |
| | | @Positive(message = "审核结果值必须为正数") |
| | | @Min(value = 1, message = "审核结果最小为1") |
| | | @Max(value = 2, message = "审核结果最大为2") |
| | | private Byte approveResult; |
| | | |
| | | /** |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long deleted; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoOp; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-11 16:18 |
| | | * @LastEditTime 2024-11-11 16:18 |
| | | * @Description 巡检员问题上报实体类 |
| | | */ |
| | | |
| | | @TableName(value="ope_issue_report", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class OpeIssueReport implements BaseEntity { |
| | | public static final long serialVersionUID = 202411111622001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 问题内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 照片列表 |
| | | */ |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private JSONArray images; |
| | | |
| | | /** |
| | | * 音频列表 |
| | | */ |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private JSONArray audios; |
| | | |
| | | /** |
| | | * 视频列表 |
| | | */ |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private JSONArray videos; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private BigDecimal lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private BigDecimal lat; |
| | | |
| | | /** |
| | | * 巡检员ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long inspectorId; |
| | | |
| | | /** |
| | | * 上报时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reportTime; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 状态;1-未受理,2-已受理,3已删除 |
| | | */ |
| | | private Byte state; |
| | | } |
| | |
| | | * @author ZhuBaoMin |
| | | * @date 2024-10-29 16:53 |
| | | * @LastEditTime 2024-10-29 16:53 |
| | | * @Description 问题上报实体类 |
| | | * @Description 农户问题上报实体类 |
| | | */ |
| | | |
| | | @TableName(value="se_issue_report", autoResultMap = true) |
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.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-08 14:59 |
| | | * @LastEditTime 2024-11-08 14:59 |
| | | * @Description |
| | | */ |
| | | |
| | | @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; |
| | | |
| | | /** |
| | | * 问题结果ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long proResultId; |
| | | |
| | | /** |
| | | * 工单ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long workOrderId; |
| | | |
| | | /** |
| | | * 巡检员ID |
| | | */ |
| | | private String inspector; |
| | | |
| | | /** |
| | | * 结果内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 照片列表 |
| | | */ |
| | | private String images; |
| | | |
| | | /** |
| | | * 音频列表 |
| | | */ |
| | | private String audios; |
| | | |
| | | /** |
| | | * 视频列表 |
| | | */ |
| | | private String videos; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private BigDecimal lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private BigDecimal lat; |
| | | |
| | | /** |
| | | * 任务完成时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date completeTime; |
| | | |
| | | /** |
| | | * 上报时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reportTime; |
| | | |
| | | /** |
| | | * 状态;1-已上报,2-已通过,3-已驳回 |
| | | */ |
| | | private Byte state; |
| | | |
| | | /** |
| | | * 状态名称 |
| | | */ |
| | | private String stateName; |
| | | |
| | | } |
| | |
| | | <item5 rechargeAmount = "500" sort = "5"/> |
| | | <item6 rechargeAmount = "1000" sort = "6"/> |
| | | </rechargeProfile> |
| | | <taskType> |
| | | <item1 typeName="设备安装"/> |
| | | <item2 typeName="设备维修"/> |
| | | <item3 typeName="设备保养"/> |
| | | </taskType> |
| | | </org1> |
| | | <org2 tag="sp" name="沙盘" enable="true"> |
| | | <districts> |
| | |
| | | <item5 rechargeAmount = "500" sort = "5"/> |
| | | <item6 rechargeAmount = "1000" sort = "6"/> |
| | | </rechargeProfile> |
| | | <taskType> |
| | | <item1 typeName="设备安装"/> |
| | | <item2 typeName="设备维修"/> |
| | | <item3 typeName="设备保养"/> |
| | | </taskType> |
| | | </org2> |
| | | <org3 tag="test" name="测试" enable="true"> |
| | | <districts> |
| | |
| | | <item5 rechargeAmount = "500" sort = "5"/> |
| | | <item6 rechargeAmount = "1000" sort = "6"/> |
| | | </rechargeProfile> |
| | | <taskType> |
| | | <item1 typeName="设备安装"/> |
| | | <item2 typeName="设备维修"/> |
| | | <item3 typeName="设备保养"/> |
| | | </taskType> |
| | | </org3> |
| | | </orgs> |
| | | </config> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoOp.OpeIssueReportMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoOp.OpeIssueReport"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ope_issue_report--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="content" jdbcType="VARCHAR" property="content" /> |
| | | <result column="images" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="images" /> |
| | | <result column="audios" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="audios" /> |
| | | <result column="videos" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="videos" /> |
| | | <result column="lng" jdbcType="DECIMAL" property="lng" /> |
| | | <result column="lat" jdbcType="DECIMAL" property="lat" /> |
| | | <result column="inspector_id" jdbcType="BIGINT" property="inspectorId" /> |
| | | <result column="report_time" jdbcType="TIMESTAMP" property="reportTime" /> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone" /> |
| | | <result column="state" jdbcType="TINYINT" property="state" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, content, images, audios, videos, lng, lat, inspector_id, report_time, phone, |
| | | `state` |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ope_issue_report |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ope_issue_report |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeIssueReport"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_issue_report (id, content, images, |
| | | audios, videos, lng, |
| | | lat, inspector_id, report_time, |
| | | phone, `state`) |
| | | values (#{id,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}, #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{lng,jdbcType=DECIMAL}, |
| | | #{lat,jdbcType=DECIMAL}, #{inspectorId,jdbcType=BIGINT}, #{reportTime,jdbcType=TIMESTAMP}, |
| | | #{phone,jdbcType=VARCHAR}, #{state,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeIssueReport"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_issue_report |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="content != null"> |
| | | content, |
| | | </if> |
| | | <if test="images != null"> |
| | | images, |
| | | </if> |
| | | <if test="audios != null"> |
| | | audios, |
| | | </if> |
| | | <if test="videos != null"> |
| | | videos, |
| | | </if> |
| | | <if test="lng != null"> |
| | | lng, |
| | | </if> |
| | | <if test="lat != null"> |
| | | lat, |
| | | </if> |
| | | <if test="inspectorId != null"> |
| | | inspector_id, |
| | | </if> |
| | | <if test="reportTime != null"> |
| | | report_time, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone, |
| | | </if> |
| | | <if test="state != null"> |
| | | `state`, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="content != null"> |
| | | #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="images != null"> |
| | | #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="audios != null"> |
| | | #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="videos != null"> |
| | | #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="lng != null"> |
| | | #{lng,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="lat != null"> |
| | | #{lat,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="inspectorId != null"> |
| | | #{inspectorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="reportTime != null"> |
| | | #{reportTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeIssueReport"> |
| | | <!--@mbg.generated--> |
| | | update ope_issue_report |
| | | <set> |
| | | <if test="content != null"> |
| | | content = #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="images != null"> |
| | | images = #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="audios != null"> |
| | | audios = #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="videos != null"> |
| | | videos = #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="lng != null"> |
| | | lng = #{lng,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="lat != null"> |
| | | lat = #{lat,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="inspectorId != null"> |
| | | inspector_id = #{inspectorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="reportTime != null"> |
| | | report_time = #{reportTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeIssueReport"> |
| | | <!--@mbg.generated--> |
| | | update ope_issue_report |
| | | set content = #{content,jdbcType=VARCHAR}, |
| | | images = #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | audios = #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | videos = #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | lng = #{lng,jdbcType=DECIMAL}, |
| | | lat = #{lat,jdbcType=DECIMAL}, |
| | | inspector_id = #{inspectorId,jdbcType=BIGINT}, |
| | | report_time = #{reportTime,jdbcType=TIMESTAMP}, |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | `state` = #{state,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据workOrderId获取未删除的处理结果数量,添加结果上报前判断使用--> |
| | | <select id="getValidResultCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM ope_processing_result WHERE deleted = 0 AND work_order_id = #{workOrderId} |
| | | <!--根据工单ID获取未删除的工单对象--> |
| | | <select id="getByWorkOrderId" resultType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> |
| | | SELECT * FROM ope_processing_result WHERE deleted = 0 AND work_order_id = #{workOrderId} LIMIT 1 |
| | | </select> |
| | | |
| | | <!--获取指定巡检员的指定未删除且未审批的处理结果上报,删除处理结果前判断使用使用--> |
| | | <select id="getProResult" resultType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> |
| | | SELECT * FROM ope_processing_result |
| | | WHERE deleted = 0 AND state = 1 AND id = #{proResultId} AND inspector_id = #{inspectorId} LIMIT 1 |
| | | </select> |
| | | |
| | | <!--逻辑删除一个未删除的处理结果记录--> |
| | | <update id="deleteProResult"> |
| | | UPDATE ope_processing_result SET deleted = UNIX_TIMESTAMP() WHERE deleted = 0 AND id = #{proResultId} |
| | | </update> |
| | | |
| | | <!--根据主键获取处理结果视图对象--> |
| | | <select id="getProResultById" resultType="com.dy.pipIrrGlobal.voOp.VoProcessingResult"> |
| | | SELECT |
| | | res.id AS proResultId, |
| | | res.work_order_id AS workOrderId, |
| | | us.name AS inspector, |
| | | res.content, |
| | | res.images, |
| | | res.audios, |
| | | res.videos, |
| | | res.lng, |
| | | res.lat, |
| | | res.complete_time AS completeTime, |
| | | res.report_time AS reportTime, |
| | | res.state, |
| | | CASE |
| | | WHEN res.state = 1 THEN '已上报' |
| | | WHEN res.state = 2 THEN '已通过' |
| | | WHEN res.state = 3 THEN '已驳回' |
| | | END AS stateName |
| | | FROM ope_processing_result res |
| | | INNER JOIN ba_user us ON us.id = res.inspector_id |
| | | WHERE res.deleted = 0 AND res.id = #{proResultId} |
| | | </select> |
| | | </mapper> |
| | |
| | | WHERE ord.deleted = 0 AND ord.id = #{workOrderId} |
| | | </select> |
| | | |
| | | <!--获取指定派单人的指定未删除工单,删除工单前判断使用使用--> |
| | | <!--获取指定派单人的、未上报的指定未删除工单,删除工单前判断使用使用--> |
| | | <select id="getWorkOrder" resultType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder"> |
| | | SELECT * FROM ope_work_order |
| | | WHERE deleted = 0 AND id = #{workOrderId} AND dispatcher_id = #{dispatcherId} LIMIT 1 |
| | | SELECT |
| | | * |
| | | FROM ope_work_order ord |
| | | WHERE deleted = 0 |
| | | AND NOT EXISTS(SELECT * FROM ope_processing_result res WHERE res.work_order_id = ord.id) |
| | | AND id = #{workOrderId} AND dispatcher_id = #{dispatcherId} LIMIT 1 |
| | | </select> |
| | | |
| | | <!--逻辑删除一个未删除的工单--> |
| | |
| | | </trim> |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!--根据取水口编号获取取水口对象--> |
| | | <select id="getIntakeByName" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> |
| | | SELECT con.intakeId, |
| | | con.rtuAddr, |
| | | inta.name AS intakeNum, |
| | | rtus.isOnLine |
| | | SELECT |
| | | con.intakeId, |
| | | con.rtuAddr, |
| | | inta.name AS intakeNum |
| | | FROM pr_controller con |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | left JOIN JSON_TABLE( |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS ( |
| | | rtuAddr VARCHAR(20) PATH '$.rtuAddr', |
| | | isOnLine BOOLEAN PATH '$.isOnLine' |
| | | ) |
| | | ) rtus ON con.rtuAddr = rtus.rtuAddr |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | <where> |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND LOWER(inta.name) = #{intakeNum} |
New file |
| | |
| | | package com.dy.pipIrrApp.issue; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeIssueReport; |
| | | 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 java.util.Objects; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-11 16:29 |
| | | * @LastEditTime 2024-11-11 16:29 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="issue") |
| | | @RequiredArgsConstructor |
| | | public class IssueCtrl { |
| | | private final IssueSv issueSv; |
| | | |
| | | /** |
| | | * 添加巡检员问题上报记录 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "addIssueReport") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> addIssueReport(@RequestBody @Valid OpeIssueReport po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | String result = issueSv.addIssueReport(po); |
| | | if(!result.equals("success")) { |
| | | return BaseResponseUtils.buildErrorMsg(result); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrApp.issue; |
| | | |
| | | import com.dy.pipIrrGlobal.daoOp.OpeIssueReportMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeIssueReport; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-11 16:29 |
| | | * @LastEditTime 2024-11-11 16:29 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class IssueSv { |
| | | @Autowired |
| | | private OpeIssueReportMapper opeIssueReportMapper; |
| | | |
| | | /** |
| | | * 添加巡检员问题上报 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public String addIssueReport(OpeIssueReport po) { |
| | | po.setReportTime(new Date()); |
| | | po.setState((byte)1); |
| | | opeIssueReportMapper.insert(po); |
| | | Long issueReportId = po.getId(); |
| | | if(issueReportId == null) { |
| | | return "巡检员问题上报失败"; |
| | | } |
| | | |
| | | return "success"; |
| | | } |
| | | |
| | | /** |
| | | * 添加巡检员问题上报信息 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | //public Long insertIssueReport(OpeIssueReport po) { |
| | | // opeIssueReportMapper.insert(po); |
| | | // return po.getId(); |
| | | //} |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrApp.workOrder; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | 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.workOrder.dto.DtoDeleteProResult; |
| | | import com.dy.pipIrrApp.workOrder.dto.DtoDeleteWorkOrder; |
| | | import com.dy.pipIrrApp.workOrder.qo.QoWorkOrder; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeApproveResult; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder; |
| | | import com.dy.pipIrrGlobal.voOp.VoProcessingResult; |
| | | import com.dy.pipIrrGlobal.voOp.VoWorkOrder; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | OpeWorkOrder workOrder = workOrderSv.getWorkOrder(deleteWorkOrder.getDispatcherId(), deleteWorkOrder.getWorkOrderId()); |
| | | OpeWorkOrder workOrder = workOrderSv.getWorkOrder(deleteWorkOrder.getWorkOrderId(), deleteWorkOrder.getDispatcherId()); |
| | | if(workOrder == null) { |
| | | return BaseResponseUtils.buildErrorMsg("您要删除的工单不存在"); |
| | | } |
| | |
| | | if(workOrderSv.deleteWorkOrder(deleteWorkOrder.getWorkOrderId()) == 0) { |
| | | return BaseResponseUtils.buildErrorMsg("工单删除失败"); |
| | | } |
| | | |
| | | |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getOneWorkOrder") |
| | | @SsoAop() |
| | | public BaseResponse<VoWorkOrder> getOneWorkOrder(@RequestParam("workOrderId") Long workOrderId) { |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(workOrderSv.getWorkOrderById(workOrderId)); |
| | |
| | | |
| | | /** |
| | | * 上报工单处理结果 |
| | | * 判断该工单是否存在有效的处理结果,如果存在则提示用户该工单已存在处理结果 |
| | | * 添加处理结果回复 |
| | | * 1.未上报的,直接上报 |
| | | * 2. 已上报的的,提示用户不能重复上报 |
| | | * 3. 已通过的,提示用户处理结果处理结果已通过 |
| | | * 4. 驳回的,逻辑删除原处理结果,上报新的处理结果 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "addProcessingResult") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> addProcessingResult(@RequestBody @Valid OpeProcessingResult po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(workOrderSv.hasValidProcessingResult(po.getWorkOrderId())) { |
| | | return BaseResponseUtils.buildErrorMsg("该工单存在有效的处理结果"); |
| | | } |
| | | |
| | | Long processingResultId = workOrderSv.insertProcessingResult(po); |
| | | if(processingResultId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("上报工单处理结果失败"); |
| | | String result = workOrderSv.addProcessingResult(po); |
| | | if(!result.equals("success")) { |
| | | return BaseResponseUtils.buildErrorMsg(result); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除一个处理结果 |
| | | * @param deleteProResult |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "deleteProResult") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteProResult(@RequestBody @Valid DtoDeleteProResult deleteProResult, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | OpeProcessingResult proResult = workOrderSv.getProResult(deleteProResult.getProResultId(), deleteProResult.getInspectorId()); |
| | | if(proResult == null) { |
| | | return BaseResponseUtils.buildErrorMsg("您要删除的处理结果不存在"); |
| | | } |
| | | |
| | | if(workOrderSv.deleteProResult(deleteProResult.getProResultId()) == 0) { |
| | | return BaseResponseUtils.buildErrorMsg("处理结果删除失败"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | | |
| | | /** |
| | | * 获取处理结果详情 |
| | | * @param proResultId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getProResult") |
| | | @SsoAop() |
| | | public BaseResponse<VoProcessingResult> getProResult(@RequestParam("proResultId") Long proResultId) { |
| | | try { |
| | | String aa = JSON.toJSONString(workOrderSv.getProResultById(proResultId)); |
| | | System.out.println(aa); |
| | | return BaseResponseUtils.buildSuccess(workOrderSv.getProResultById(proResultId)); |
| | | } catch (Exception e) { |
| | | log.error("获取处理结果详情异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 审核处理结果 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "approveProResult") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> approveProResult(@RequestBody @Valid OpeApproveResult po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | String result = workOrderSv.approveProResult(po); |
| | | if(!result.equals("success")) { |
| | | return BaseResponseUtils.buildErrorMsg(result); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrApp.workOrder.qo.QoWorkOrder; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeApproveResultMapper; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeProcessingResultMapper; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeWorkOrderMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeApproveResult; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder; |
| | | import com.dy.pipIrrGlobal.voOp.VoProcessingResult; |
| | | import com.dy.pipIrrGlobal.voOp.VoWorkOrder; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | |
| | | @Autowired |
| | | private OpeProcessingResultMapper opeProcessingResultMapper; |
| | | |
| | | @Autowired |
| | | private OpeApproveResultMapper opeApproveResultMapper; |
| | | |
| | | /** |
| | | * 添加工单记录 |
| | | * @param po |
| | |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | public OpeWorkOrder getWorkOrder(Long dispatcherId, Long workOrderId) { |
| | | return opeWorkOrderMapper.getWorkOrder(dispatcherId, workOrderId); |
| | | public OpeWorkOrder getWorkOrder(Long workOrderId, Long dispatcherId) { |
| | | return opeWorkOrderMapper.getWorkOrder(workOrderId, dispatcherId); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据workOrderId获取未删除的处理结果数量,添加结果上报前判断使用 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | public Boolean hasValidProcessingResult(Long workOrderId) { |
| | | if (opeProcessingResultMapper.getValidResultCount(workOrderId) == 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 上报工单处理结果 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long insertProcessingResult(OpeProcessingResult po) { |
| | | po.setReportTime(new Date()); |
| | | po.setState((byte)1); |
| | | public String addProcessingResult(OpeProcessingResult po) { |
| | | String result = ""; |
| | | OpeProcessingResult processingResult = opeProcessingResultMapper.getByWorkOrderId(po.getWorkOrderId()); |
| | | if(processingResult == null) { |
| | | // 无处理结果上报处理结果 |
| | | po.setReportTime(new Date()); |
| | | po.setState((byte)1); |
| | | po.setDeleted(0L); |
| | | opeProcessingResultMapper.insert(po); |
| | | if(po.getId() == 0) { |
| | | result = "工单处理结果上报失败"; |
| | | return result; |
| | | } |
| | | |
| | | result = "success"; |
| | | return result; |
| | | } |
| | | |
| | | switch (processingResult.getState()) { |
| | | case 1: |
| | | result = "工单处理结果已上报,请勿重复上报"; |
| | | break; |
| | | case 2: |
| | | result = "工单处理结果已通过"; |
| | | break; |
| | | case 3: |
| | | // 处理结果被驳回时,删除当前处理结果,上报新的处理结果 |
| | | processingResult.setDeleted(System.currentTimeMillis()/1000); |
| | | opeProcessingResultMapper.updateByPrimaryKeySelective(processingResult); |
| | | |
| | | po.setReportTime(new Date()); |
| | | po.setState((byte)1); |
| | | po.setDeleted(0L); |
| | | opeProcessingResultMapper.insert(po); |
| | | result = "success"; |
| | | break; |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 获取指定巡检员的指定未删除且未审批的处理结果上报,删除处理结果前判断使用使用 |
| | | * @param proResultId |
| | | * @param inspectorId |
| | | * @return |
| | | */ |
| | | public OpeProcessingResult getProResult(Long proResultId, Long inspectorId) { |
| | | return opeProcessingResultMapper.getProResult(proResultId, inspectorId); |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除一个未删除的处理结果 |
| | | * @param proResultId |
| | | * @return |
| | | */ |
| | | public Integer deleteProResult(Long proResultId) { |
| | | return opeProcessingResultMapper.deleteProResult(proResultId); |
| | | } |
| | | |
| | | /** |
| | | * 获取处理结果详情 |
| | | * @param proResultId |
| | | * @return |
| | | */ |
| | | public VoProcessingResult getProResultById(Long proResultId) { |
| | | return opeProcessingResultMapper.getProResultById(proResultId); |
| | | } |
| | | |
| | | /** |
| | | * 审核工单处理结果 |
| | | * 1. 判断指定的工单及处理结果是否存在且未完成 |
| | | * 2. 添加审核记录 |
| | | * 3. 如果审核通过 |
| | | * 处理结果状态改为已通过 |
| | | * 工单补充任务完成时间 |
| | | * 工单状态改为已完成 |
| | | * 4. 如果驳回 |
| | | * 任务处理结果改为驳回 |
| | | * 工单驳回次数加1 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public String approveProResult(OpeApproveResult po) { |
| | | |
| | | OpeProcessingResult processingResult = opeProcessingResultMapper.selectByPrimaryKey(po.getProcessingResultId()); |
| | | if(processingResult == null || processingResult.getDeleted() != 0 || processingResult.getState() != 1) { |
| | | return "处理结果不存在或已完成审核"; |
| | | } |
| | | |
| | | OpeWorkOrder workOrder = opeWorkOrderMapper.selectByPrimaryKey(po.getWorkOrderId()); |
| | | if(workOrder == null || workOrder.getDeleted() != 0 || workOrder.getState() == 2) { |
| | | return "工单不存在或已完成"; |
| | | } |
| | | |
| | | po.setApproveTime(new Date()); |
| | | po.setDeleted(0L); |
| | | opeProcessingResultMapper.insert(po); |
| | | return po.getId(); |
| | | if(opeApproveResultMapper.insert(po) == 0) { |
| | | return "审核记录添加失败"; |
| | | } |
| | | |
| | | if(po.getApproveResult() == 1) { |
| | | // 审核通过 |
| | | processingResult.setState((byte)2); |
| | | opeProcessingResultMapper.updateByPrimaryKeySelective(processingResult); |
| | | |
| | | workOrder.setCompleteTime(processingResult.getCompleteTime()); |
| | | workOrder.setState((byte)2); |
| | | opeWorkOrderMapper.updateByPrimaryKeySelective(workOrder); |
| | | |
| | | } else { |
| | | // 驳回 |
| | | processingResult.setState((byte)3); |
| | | opeProcessingResultMapper.updateByPrimaryKeySelective(processingResult); |
| | | |
| | | workOrder.setRejectTimes(workOrder.getRejectTimes() + 1); |
| | | opeWorkOrderMapper.updateByPrimaryKeySelective(workOrder); |
| | | } |
| | | |
| | | return "success"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrApp.workOrder.dto; |
| | | |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-08 11:43 |
| | | * @LastEditTime 2024-11-08 11:43 |
| | | * @Description 删除处理结果传输类 |
| | | */ |
| | | |
| | | @Data |
| | | public class DtoDeleteProResult { |
| | | public static final long serialVersionUID = 202411081144001L; |
| | | |
| | | /** |
| | | * 处理结果ID |
| | | */ |
| | | @NotNull(message = "处理结果不能为空") |
| | | private Long proResultId; |
| | | |
| | | /** |
| | | * 巡检员ID |
| | | */ |
| | | @NotNull(message = "巡检员不能为空") |
| | | private Long inspectorId; |
| | | } |
| | |
| | | }) |
| | | } |
| | | ) |
| | | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoSe","com.dy.pipIrrGlobal.daoRm","com.dy.pipIrrGlobal.daoPr","com.dy.pipIrrGlobal.daoFi"}) |
| | | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoSe","com.dy.pipIrrGlobal.daoRm", |
| | | "com.dy.pipIrrGlobal.daoPr","com.dy.pipIrrGlobal.daoFi","com.dy.pipIrrGlobal.daoOp" |
| | | }) |
| | | public class PipIrrBaseApplication { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | import com.dy.common.util.ConfigXml4Springboot; |
| | | import com.dy.common.util.MD5; |
| | | import com.dy.pipIrrGlobal.daoBa.*; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeTaskTypeMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmIrrigateProfileMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SePaymentMethodMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeRechargeProfileMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeWaterTypeMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.*; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeTaskType; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrWaterPrice; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIrrigateProfile; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | |
| | | private BaDictMapper baDictDao; |
| | | private BaDictItemMapper baDictItemDao; |
| | | private SeRechargeProfileMapper seRechargeProfileDao; |
| | | private OpeTaskTypeMapper taskTypeDao; |
| | | |
| | | @Autowired |
| | | public void setResourceLoader(ResourceLoader resourceLoader){ |
| | |
| | | @Autowired |
| | | public void setSeRechargeProfileDao(SeRechargeProfileMapper seRechargeProfileDao) { |
| | | this.seRechargeProfileDao = seRechargeProfileDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setOpeTaskTypeDao(OpeTaskTypeMapper taskTypeDao) { |
| | | this.taskTypeDao = taskTypeDao; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(!this.existTaskType()){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".taskType")){ |
| | | for(int i = 1 ; i < 10000; i++){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".taskType.item" + i)){ |
| | | String taskType = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".taskType.item" + i,"typeName", null, false, null) ; |
| | | this.saveTaskType(orgTag, taskType); |
| | | }else{ |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | }else{ |
| | | break ; |
| | |
| | | private boolean existDict() { |
| | | Long total = this.baDictDao.selectCount(null); |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | | /** |
| | | * 数据库中是否存在工单任务类型 |
| | | * @return |
| | | */ |
| | | private boolean existTaskType() { |
| | | Long total = this.taskTypeDao.selectCount(null); |
| | | return (total != null && total > 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | po.setDeleted(0L); |
| | | this.baDictItemDao.insert(po); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存工单任务类型 |
| | | * @param orgTag |
| | | * @param task_type |
| | | */ |
| | | private void saveTaskType(String orgTag, String task_type) { |
| | | if(task_type != null && !task_type.trim().equals("")) { |
| | | OpeTaskType po = new OpeTaskType(); |
| | | po.setTaskType(task_type); |
| | | po.setDeleted(0L); |
| | | this.taskTypeDao.insert(po); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | //@GetMapping(path = "one_intake") |
| | | @GetMapping(path = "all_intakes") |
| | | public BaseResponse<QueryResultVo<VoOnLineIntake>> getOneIntake(OnLineIntakesQO qo) { |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | public VoOnLineIntake selectOneIntake(OnLineIntakesQO qo) { |
| | | Command com = new Command() ; |
| | | com.id = Command.defaultId; |
| | | com.code = "LCD0001"; |
| | | com.type = "innerCommand"; |
| | | comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); |
| | | //Command com = new Command() ; |
| | | //com.id = Command.defaultId; |
| | | //com.code = "LCD0001"; |
| | | //com.type = "innerCommand"; |
| | | //comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); |
| | | // |
| | | //JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | // |
| | | //JSONArray jsonArray = new JSONArray(); |
| | | //if(response != null && response.getString("code").equals("0001")) { |
| | | // JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | // if(attachment != null) { |
| | | // attachment.forEach((key, value) -> { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.put("rtuAddr", key); |
| | | // jsonObject.put("isOnLine", value); |
| | | // jsonArray.add(jsonObject); |
| | | // }); |
| | | // } |
| | | //} |
| | | //qo.setOnLineMap(jsonArray.toJSONString()); |
| | | |
| | | JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(response != null && response.getString("code").equals("0001")) { |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | if(attachment != null) { |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | }); |
| | | } |
| | | //} else { |
| | | // return new VoOnLineIntake(); |
| | | } |
| | | |
| | | qo.setOnLineMap(jsonArray.toJSONString()); |
| | | // 如果 intakeNum 不为空,则转为小写再写入qo对象 |
| | | String intakeNum = qo.getIntakeNum(); |
| | | if(intakeNum != null) { |
| | |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoOnLineIntake>> selectAllIntakes(OnLineIntakesQO qo) { |
| | | Command com = new Command() ; |
| | | com.id = Command.defaultId; |
| | | com.code = "LCD0001"; |
| | | com.type = "innerCommand"; |
| | | comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); |
| | | //Command com = new Command() ; |
| | | //com.id = Command.defaultId; |
| | | //com.code = "LCD0001"; |
| | | //com.type = "innerCommand"; |
| | | //comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); |
| | | // |
| | | //JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | // |
| | | //JSONArray jsonArray = new JSONArray(); |
| | | //if(response != null && response.getString("code").equals("0001")) { |
| | | // JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | // if(attachment != null) { |
| | | // attachment.forEach((key, value) -> { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.put("rtuAddr", key); |
| | | // jsonObject.put("isOnLine", value); |
| | | // jsonArray.add(jsonObject); |
| | | // }); |
| | | // } |
| | | //} |
| | | //qo.setOnLineMap(jsonArray.toJSONString()); |
| | | |
| | | JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(response != null && response.getString("code").equals("0001")) { |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | if(attachment != null) { |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | }); |
| | | } |
| | | //} else { |
| | | // QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>(); |
| | | // return rsVo; |
| | | } |
| | | |
| | | qo.setOnLineMap(jsonArray.toJSONString()); |
| | | // 如果 intakeNum 不为空,则转为小写再写入qo对象 |
| | | String intakeNum = qo.getIntakeNum(); |
| | | if(intakeNum != null) { |
| | |
| | | package com.dy.pipIrrWechat.intake.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import jakarta.validation.constraints.Max; |
| | | import jakarta.validation.constraints.Min; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class OnLineIntakesQO extends QueryConditionVo { |
| | | /** |
| | | * 中间件返回的RTU在线情况对象数组 |
| | | */ |
| | | private String onLineMap; |
| | | |
| | | /** |
| | | * 取水口编号 |
| | | */ |
| | | private String intakeNum; |
| | | |
| | | /** |
| | | * 是否在线 |
| | | */ |
| | | @Max(value = 1,message = "是否在线仅允许为真或假") |
| | | @Min(value = 0,message = "是否在线仅允许为真或假") |
| | | private Boolean isOnLine; |
| | | } |
| | |
| | | package com.dy.pipIrrWechat.issue; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | 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.pipIrrGlobal.voSe.VoIssueReport; |
| | | import com.dy.pipIrrGlobal.voSe.VoIssueReportReply; |
| | | import com.dy.pipIrrWechat.issue.dto.DtoDeleteParam; |
| | | 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 org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | */ |
| | | @PostMapping(path = "addIssueReport") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BaseResponse<Boolean> addIssueReport(@RequestBody @Valid DtoIssueReport po, BindingResult bindingResult) { |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> addIssueReport(@RequestBody @Valid SeIssueReport po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Long clientId = po.getClientId(); |
| | | String phone = Optional.ofNullable(po.getPhone()).orElse(""); |
| | | BigDecimal lng = Optional.ofNullable(po.getLng()).orElse(BigDecimal.valueOf(0)); |
| | | BigDecimal lat = Optional.ofNullable(po.getLat()).orElse(BigDecimal.valueOf(0)); |
| | | String content = Optional.ofNullable(po.getContent()).orElse(""); |
| | | JSONArray images = Optional.ofNullable(po.getImages()).orElse(new JSONArray()); |
| | | JSONArray audios = Optional.ofNullable(po.getAudios()).orElse(new JSONArray()); |
| | | JSONArray videos = Optional.ofNullable(po.getVideos()).orElse(new JSONArray()); |
| | | |
| | | SeIssueReport seIssueReport = new SeIssueReport(); |
| | | seIssueReport.setClientId(clientId); |
| | | seIssueReport.setPhone(phone); |
| | | seIssueReport.setLng(lng); |
| | | seIssueReport.setLat(lat); |
| | | seIssueReport.setContent(content); |
| | | seIssueReport.setImages(images); |
| | | seIssueReport.setAudios(audios); |
| | | seIssueReport.setVideos(videos); |
| | | seIssueReport.setReportTime(new Date()); |
| | | seIssueReport.setState((byte)1); |
| | | Long issueReportId = issueSv.insertIssueReport(seIssueReport); |
| | | if(issueReportId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("农户问题上报失败"); |
| | | String result = issueSv.addIssueReport(po); |
| | | if(!result.equals("success")) { |
| | | return BaseResponseUtils.buildErrorMsg(result); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | private SeReportReplyMapper seReportReplyMapper; |
| | | |
| | | /** |
| | | * 添加问题上报信息 |
| | | * 添加用户问题上报 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long insertIssueReport(SeIssueReport po) { |
| | | public String addIssueReport(SeIssueReport po) { |
| | | po.setReportTime(new Date()); |
| | | po.setState((byte)1); |
| | | seIssueReportMapper.insert(po); |
| | | return po.getId(); |
| | | Long issueReportId = po.getId(); |
| | | if(issueReportId == null) { |
| | | return "农户问题上报失败"; |
| | | } |
| | | |
| | | return "success"; |
| | | } |
| | | |
| | | /** |