liurunyu
2024-04-02 0eaef592517ced667ed16413f9d22ab677915101
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowMonitoringCtrl.java
@@ -43,6 +43,7 @@
    /**
     * 添加管网流量监测站
     *
     * @param po
     * @param bindingResult
     * @return
@@ -64,7 +65,7 @@
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        if (villageId != null) {
        /**
         * 获取5级行政区划信息
         */
@@ -72,11 +73,17 @@
        if(map_districts.size() <= 0) {
            return BaseResponseUtils.buildFail("区划信息有误");
        }
        Long countryId = Long.parseLong(map_districts.get("countryId").toString());
        Long townId = Long.parseLong(map_districts.get("townId").toString());
        po.setCountyid(countryId);
        po.setTownid(townId);
        }
        if (po.getName() == null){
            return BaseResponseUtils.buildFail("监测站名称不能为空");}
        if (po.getName().length()>25||po.getName().length()<1){
            return BaseResponseUtils.buildFail("25>监测站名称>1");}
        if (po.getLat()== null||po.getLng()== null){
            return BaseResponseUtils.buildFail("经纬度不能为空");}
        Date operateTime = new Date();
        po.setOperatedt(operateTime);
@@ -90,6 +97,7 @@
    /**
     * 删除流量监测站
     *
     * @param map
     * @return
     */
@@ -119,6 +127,7 @@
    /**
     * 编辑修改监测站
     *
     * @param po 保存监测站form表单对象
     * @return 是否成功
     */
@@ -139,6 +148,7 @@
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        if (villageId != null) {
        /**
         * 获取5级行政区划信息
         */
@@ -150,6 +160,8 @@
        Long townId = Long.parseLong(map_districts.get("townId").toString());
        po.setCountyid(countryId);
        po.setTownid(townId);
        }
        int count;
        Date operateTime = new Date();
        po.setOperatedt(operateTime);
@@ -169,6 +181,7 @@
    /**
     * 客户端请求得到所有监测站名字
     *
     * @return 所有监测站名字
     */
    @Operation(summary = "获得全部监测站", description = "返回全部监测站数据")
@@ -198,6 +211,7 @@
    /**
     * 得到一个监测站数据
     *
     * @return 一个监测站数据
     */
    @Operation(summary = "一个监测站", description = "得到一个监测站数据")
@@ -242,7 +256,6 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}