2021与蓝度共同重构项目,服务端
liuhaonan
2022-08-12 4e53338c0c6859a43693f3f690f0c05da888a02e
Merge remote-tracking branch 'origin/master'
已修改4个文件
34 ■■■■ 文件已修改
dao/src/main/java/com/sandu/ximon/dao/bo/C3ChargingBo.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/C3mChargingMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/AirEquipmentService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/bo/C3ChargingBo.java
@@ -47,9 +47,9 @@
    private LocalDateTime updateTime;
    /**
     * 灯杆编号
     * 灯杆ID
     */
    private Long poleCode;
    private Long poleId;
    /**
     * 灯杆名称
dao/src/main/resources/mapper/C3mChargingMapper.xml
@@ -27,11 +27,12 @@
        where c3_mac = #{c3Mac}
    </select>
    <select id="listC3mChargingDto" resultType="com.sandu.ximon.dao.bo.C3ChargingBo">
        SELECT t1.*, t3.pole_code,
        SELECT t1.*,
        t3.id AS pole_id,
        t3.pole_name
        FROM c3m_charging t1
        LEFT JOIN pole_binding t2 ON t1.mcu_udid = t2.device_code
        AND t2.device_type = 8
        AND t2.device_type = 2
        LEFT JOIN pole t3 ON t3.id = t2.pole_id
        <where>
            <if test="keyword != null and keyword != ''">
ximon-admin/src/main/java/com/sandu/ximon/admin/service/AirEquipmentService.java
@@ -220,6 +220,7 @@
     * @return
     */
    public A5AtmosphereQuerySensorInfoReportInnerFrame.SensorInfoPackage QuerySensorInfo(String mac) {
        //TODO
        if (StringUtil.strIsNullOrEmpty(mac)) {
            throw new BusinessException("灯杆mac参数错误!");
        }
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
@@ -101,12 +101,24 @@
        PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, param.getDeviceCode()));
        if (one == null) {
            //充电桩保存绑定关系需要先判断是不是正确的灯杆
            if (deviceType == 2) {
                C3mCharging mCharging = SpringContextHolder.getBean(C3ChargingService.class).
                        getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, param.getDeviceCode()));
                Pole poleInfo = SpringContextHolder.getBean(PoleService.class).getById(poleId);
                if (!mCharging.getPoleDevicesCode().equals(poleInfo.getDeviceCode())) {
                    throw new BusinessException("绑定出错!该充电桩硬件绑定的灯杆mac为:" + mCharging.getPoleDevicesCode());
                }
            }
            PoleBinding poleBinding = new PoleBinding();
            poleBinding.setPoleId(poleId);
            poleBinding.setDeviceType(deviceType);
            poleBinding.setDeviceName(param.getDeviceName());
            poleBinding.setDeviceCode(param.getDeviceCode());
            return save(poleBinding);
        } else {
            //修改单灯的绑定关系的时候要额外处理的事务
            // 删除灯杆的devicescode
@@ -119,6 +131,18 @@
                }
            }
            //充电桩保存绑定关系需要先判断是不是正确的灯杆
            if (deviceType == 2) {
                C3mCharging mCharging = SpringContextHolder.getBean(C3ChargingService.class).
                        getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, param.getDeviceCode()));
                Pole poleInfo = SpringContextHolder.getBean(PoleService.class).getById(poleId);
                if (!mCharging.getPoleDevicesCode().equals(poleInfo.getDeviceCode())) {
                    throw new BusinessException("绑定出错!该充电桩硬件绑定的灯杆mac为:" + mCharging.getPoleDevicesCode());
                }
            }
            one.setPoleId(poleId);
            one.setDeviceType(param.getDeviceType());
            one.setDeviceName(param.getDeviceName());