rain
2024-04-17 b6294bd36b3023e18606c77553fe136e6500a4b2
完善DB数据配置
7 files modified
27 ■■■■ changed files
src/main/java/com/dji/sample/patches/controller/PatchesController.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/service/GetPatchesService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/service/impl/GetPatchesServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/territory/controller/TbFjController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/territory/model/entity/TbFjEntity.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/territory/service/impl/TbFjServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/resources/application-prod.yml 2 ●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/controller/PatchesController.java
@@ -135,4 +135,9 @@
        }
        return ResponseResult.success(infoMap);
    }
    @PostMapping("/test")
    public void test(){
        List<LotInfo> list=getPatchesService.listLotinfo();
        tbDkjbxxService.insert(list);
    }
}
src/main/java/com/dji/sample/patches/service/GetPatchesService.java
@@ -41,4 +41,6 @@
     * @return 返回匹配给定地块编号和工作空间ID的地块信息对象。如果找不到匹配的记录,则返回null。
     */
     LotInfo getLotinfo(String dkbh,String workspaceId);
    List<LotInfo>listLotinfo();
}
src/main/java/com/dji/sample/patches/service/impl/GetPatchesServiceImpl.java
@@ -81,4 +81,7 @@
       return mapper.selectOne(new LambdaQueryWrapper<LotInfo>().eq(LotInfo::getDkbh, dkbh)
                .eq(LotInfo::getWorkspaceId, workspaceId));
    }
    public List<LotInfo>listLotinfo(){
        return mapper.selectList(null);
    }
}
src/main/java/com/dji/sample/territory/controller/TbFjController.java
@@ -27,10 +27,10 @@
    public ResponseResult insertDb(String dkbh, String workspaceId) throws IOException {
        List<MediaFileEntity> list = getPatches.listPohto(dkbh, workspaceId);
        if(list.size()==0){
            return ResponseResult.error("未找到照片信息");}
            return ResponseResult.error("未找到该照片、视频信息");}
        LotInfo lotInfo = getPatches.getLotinfo(dkbh, workspaceId);
        if(lotInfo==null){
            return ResponseResult.error("未找到图斑信息");}
            return ResponseResult.error("未找到该图斑信息");}
        TbFjEntity entity=tbFJService.insertData(list, lotInfo);
        if (entity!=null){
            return ResponseResult.success("上传成功");
src/main/java/com/dji/sample/territory/model/entity/TbFjEntity.java
@@ -35,4 +35,10 @@
    private Double longitude;
    private Double Latitude;
    private String fjmc;
    private int fjlx;
    private Double psfyj;
}
src/main/java/com/dji/sample/territory/service/impl/TbFjServiceImpl.java
@@ -59,11 +59,13 @@
        JSONObject jsonObject = JSONObject.parseObject(jsonString);
        Double absoluteAltitude = jsonObject.getDouble("absoluteAltitude");
        Double relativeAltitude = jsonObject.getDouble("relativeAltitude");
        Double gimbalYawDegree = jsonObject.getDouble("gimbalYawDegree");
        JSONObject shootPosition = jsonObject.getJSONObject("shootPosition");
        Double lat = shootPosition.getDouble("lat");
        Double lng = shootPosition.getDouble("lng");
        Long pssj = mediaFile.getCreateTime();
        String bsm= UUID.randomUUID().toString();
        String fjmc= mediaFile.getFileName();
        String key = mediaFile.getObjectKey();
        String head = "http://dev.jxpskj.com:9000/cloud-bucket";
        String url = head + key;
@@ -79,6 +81,9 @@
                .Latitude(lat)
                .longitude(lng)
                .fj(FJ)
                .fjmc(fjmc)
                .fjlx(1)
                .psfyj(gimbalYawDegree)
                .pssj(String.valueOf(pssj))
                .build();}
        else {
src/main/resources/application-prod.yml
@@ -14,7 +14,7 @@
          password: jxpskj_2018
        sqlite:
          driver-class-name: org.sqlite.JDBC
          url: jdbc:sqlite::/home/drone/server/sqlite/resource_db.db
          url: jdbc:sqlite:/home/drone/server/sqlite/resource_db.db
          username:
          password:
#      url: jdbc:mysql://182.108.40.114:3308/drone_zt_test?useSSL=false&allowPublicKeyRetrieval=true