liurunyu
2025-01-21 daa7c1b49bec0e07aa94ffedcb410ddeed2f4c61
取水统合数据功能部分实现
7个文件已添加
1个文件已修改
269 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/VoAllRound/VoArIntakeBase.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/VoAllRound/VoArIntakeRemote.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoAllRound/Ar4BaseMapper.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/Ar4BaseMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/PipIrrBaseApplication.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/allRound/Ar4BaseCtrl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/allRound/Ar4BaseSv.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/allRound/说明.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/VoAllRound/VoArIntakeBase.java
New file
@@ -0,0 +1,47 @@
package com.dy.pipIrrGlobal.VoAllRound;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Data;
/**
 * @Author: liurunyu
 * @Date: 2025/1/14 16:01
 * @Description
 */
@Data
@JsonPropertyOrder({"id", "num", "lng","lat", "blockName", "rtuAddr"})
public class VoArIntakeBase {
    private static final long serialVersionUID = 202501141601001L;
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long id;
    /**
     * ç¼–号
     */
    public String num;
    /**
     * ç»åº¦
     */
    public Double lng;
    /**
     * çº¬åº¦
     */
    public Double lat;
    /**
     * ç‰‡åŒº
     */
    public String blockName;
    /**
     * æŽ§åˆ¶å™¨åœ°å€
     */
    public String rtuAddr ;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/VoAllRound/VoArIntakeRemote.java
New file
@@ -0,0 +1,49 @@
package com.dy.pipIrrGlobal.VoAllRound;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Data;
import java.util.Date;
/**
 * @Author: liurunyu
 * @Date: 2025/1/14 17:03
 * @Description
 */
@Data
@JsonPropertyOrder({"id", "onLine", "alarm", "alarmDt", "lastOpenDt", "lastCloseDt"})
public class VoArIntakeRemote {
    private static final long serialVersionUID = 202501141703001L;
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long id;
    /**
     * åœ¨çº¿æƒ…况, true在线,false离线,null未知
     */
    public Boolean onLine ;
    /**
     * æœ€æ–°æŠ¥è­¦ä¿¡æ¯
     */
    public String alarm ;
    /**
     * æœ€æ–°æŠ¥è­¦æ—¶é—´
     */
    public Date alarmDt ;
    /**
     * æœ€åŽå¼€é˜€æ—¶é—´
     */
    public Date lastOpenDt ;
    /**
     * æœ€åŽå…³é—­æ—¶é—´
     */
    public Date lastCloseDt ;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoAllRound/Ar4BaseMapper.java
New file
@@ -0,0 +1,31 @@
package com.dy.pipIrrGlobal.daoAllRound;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.VoAllRound.VoArIntakeBase;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @Author: liurunyu
 * @Date: 2025/1/14 16:45
 * @Description
 */
@Mapper
public interface Ar4BaseMapper extends BaseMapper<Object> {
    /**
     * æŸ¥è¯¢å–水口基本信息
     * @param intakeId
     * @return
     */
    List<VoArIntakeBase> intakeInfo(@Param("intakeId") Long intakeId) ;
    /**
     * æŸ¥è¯¢å–水口关联的RTU地址
     * @param intakeId
     * @return
     */
    List<String> intakeRtuAddr(@Param("intakeId") Long intakeId) ;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/Ar4BaseMapper.xml
New file
@@ -0,0 +1,26 @@
<?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.daoAllRound.Ar4BaseMapper">
    <select id="intakeInfo" resultType="com.dy.pipIrrGlobal.VoAllRound.VoArIntakeBase">
        select
        itb.id   as id,
        itb.name as num,
        itb.lng  as lng,
        itb.lat  as lat,
        bb.name  as blockName,
        pc.rtuAddr as rtuAddr
        from pr_intake itb
        LEFT JOIN ba_block bb on itb.blockId = bb.id
        LEFT JOIN pr_controller pc on itb.id = pc.intakeId
        where id = #{intakeId,jdbcType=BIGINT}
    </select>
    <select id="intakeRtuAddr" resultType="java.lang.String">
        select
        rtuAddr
        from pr_controller
        where intakeId = #{intakeId,jdbcType=BIGINT}
    </select>
</mapper>
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/PipIrrBaseApplication.java
@@ -18,9 +18,14 @@
                })
        }
)
@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"
            })
@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",
        "com.dy.pipIrrGlobal.daoAllRound"
    })
public class PipIrrBaseApplication {
    public static void main(String[] args) {
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/allRound/Ar4BaseCtrl.java
New file
@@ -0,0 +1,64 @@
package com.dy.pipIrrBase.allRound;
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.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.VoAllRound.VoArIntakeBase;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * @Author: liurunyu
 * @Date: 2025/1/14 15:56
 * @Description æœ‰å…³åŸºç¡€ä¿¡æ¯çš„综合
 */
@Slf4j
@Tag(name = "有关基础信息的综合", description = "有关基础信息的综合")
@RestController
@RequestMapping(path = "ar4Base")
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class Ar4BaseCtrl {
    private Ar4BaseSv sv;
    @Autowired
    private void setSv(Ar4BaseSv sv) {
        this.sv = sv;
    }
    /**
     * ç»¼åˆä¿¡æ¯
     * å–水口基本信息
     * @return æ‰€æœ‰ç‰‡åŒºæ•°æ®
     */
    @Operation(summary = "综合信息", description = "取水口基本信息")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "取水口基本信息(BaseResponse.content:QueryResultVo{})",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoArIntakeBase.class))}
            )
    })
    @GetMapping(path = "intakeInfo")
    @SsoAop()
    public BaseResponse<QueryResultVo<VoArIntakeBase>> intakeInfo(Long intakeId) {
        if (intakeId == null || intakeId.longValue() == 0L) {
            return BaseResponseUtils.buildException("取水口id不能为空");
        }
        QueryResultVo<VoArIntakeBase> res = this.sv.intakeInfo(intakeId);
        return BaseResponseUtils.buildSuccess(res);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/allRound/Ar4BaseSv.java
New file
@@ -0,0 +1,40 @@
package com.dy.pipIrrBase.allRound;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.VoAllRound.VoArIntakeBase;
import com.dy.pipIrrGlobal.daoAllRound.Ar4BaseMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * @Author: liurunyu
 * @Date: 2025/1/14 15:57
 * @Description
 */
@Slf4j
@Service
public class Ar4BaseSv {
    private Ar4BaseMapper dao ;
    @Autowired
    private void setDao(Ar4BaseMapper dao){
        this.dao = dao;
    }
    /**
     * å–水口基本信息
     * @return å–水口基本信息
     */
    public QueryResultVo<VoArIntakeBase> intakeInfo(Long intakeId){
        QueryResultVo<VoArIntakeBase> rsVo = new QueryResultVo<>() ;
        List<VoArIntakeBase> list = this.dao.intakeInfo(intakeId);
        if(list != null && list.size() > 0){
            rsVo.obj = list.get(0) ;
        }
        return rsVo ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/allRound/˵Ã÷.txt
New file
@@ -0,0 +1 @@
allRound代表综合