Forráskód Böngészése

修改耕地保护研判中图斑详情的查询接口和研判添加接口和结果查询接口更改

DESKTOP-2K9OVK9\siwei 4 hónapja
szülő
commit
f6411c2809

+ 6 - 7
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/GdbhReportServiceImpl.java

@@ -79,13 +79,12 @@ public class GdbhReportServiceImpl implements GdbhReportService {
         XWPFDocument document = null;
         OutputStream outputStream = null;// 把doc输出到输出流
         try {
-            RequestResult res_0 = applyService.QueryGdbhJgGeom(bsm);
-            if (res_0.isError()) {
-                throw new Exception(String.valueOf(res_0.get(RequestResult.MSG_TAG)));
-            }
-
-            Map res_1 = (Map) res_0.get(RequestResult.DATA_TAG);
-            String ewkt = (String) res_1.get("geom");
+//            RequestResult res_0 = applyService.QueryGdbhJgGeom(bsm);
+//            if (res_0.isError()) {
+//                throw new Exception(String.valueOf(res_0.get(RequestResult.MSG_TAG)));
+//            }
+//            Map res_1 = (Map) res_0.get(RequestResult.DATA_TAG);
+            String ewkt = (String) d_xmxx_0.get("geom");
 
             document = new XWPFDocument();
 

+ 6 - 4
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/gdbh/impl/GdbhHandleService.java

@@ -108,7 +108,6 @@ public class GdbhHandleService {
                 targetTableVo.setSiweiArea(true);
                 targetTableVo.setTargetTableName(tableName);
                 targetTableVo.setRawTableName(d_RawTableName);
-                targetTableVo.setIds(d_RawTableAids);
                 targetTableVo.setColumns(columns);
                 List<Map> map = httpAnalyseService.targetTable(targetTableVo);
 
@@ -142,7 +141,7 @@ public class GdbhHandleService {
             return;
         }
         String path_0 = (String) res_2.get(RequestResult.DATA_TAG);
-        System.out.println("path_0:"+path_0);
+        System.out.println("path_0:" + path_0);
         insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成结束。。。", "info");
 
         updateGdbg(gdbhDto.getBsm(), 2, null, new Date(), path_0);
@@ -218,14 +217,17 @@ public class GdbhHandleService {
                 if (StringUtils.isNotEmpty(id)) {
                     TGdbhJctb dto0 = itGdbhJctbService.selectTGdbhJctbById(id);
                     if (dto0 != null) {
-                        String jsonString = JSON.toJSONString(dto0);
                         TGdbhRwGeom tGdbhRwGeom = new TGdbhRwGeom();
                         tGdbhRwGeom.setGeom(dto0.getGeom());
                         tGdbhRwGeom.setGeomarea(dto0.getJcmj());
-                        tGdbhRwGeom.setGeomJson(jsonString);
                         tGdbhRwGeom.setSort(i0);
                         tGdbhRwGeom.setId(StringUtils.getUUID());
                         tGdbhRwGeom.setRwbsm(gdbhDto.getBsm());
+                        dto0.setGeom(null);
+                        dto0.setHsxtif(null);
+                        dto0.setQsxtif(null);
+                        String jsonString = JSON.toJSONString(dto0);
+                        tGdbhRwGeom.setGeomJson(jsonString);
                         iTGdbhRwGeomService.insertTGdbhRwGeom(tGdbhRwGeom);
                         i0++;
                     }

+ 12 - 37
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/gdbh/impl/GdbhJgService.java

@@ -10,6 +10,7 @@ import com.onemap.apply.domain.res.ApiTTable;
 import com.onemap.apply.domain.res.ApiTTableFiled;
 import com.onemap.apply.mapper.gdbh.*;
 import com.onemap.apply.service.analyse.HttpAnalyseService;
+import com.onemap.apply.service.gdbh.ITGdbhRwGeomService;
 import com.onemap.common.core.utils.NumberUtil;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.domain.AjaxResult;
@@ -19,10 +20,8 @@ import com.onemap.system.api.domain.RawTableVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import javax.annotation.Resource;
+import java.util.*;
 
 @Service
 public class GdbhJgService {
@@ -40,6 +39,8 @@ public class GdbhJgService {
     private GdbhRwMxYzMapper gdbhRwMxYzMapper;
     @Autowired
     private TableFiledRelationService tableFiledRelationService;
+    @Resource
+    private ITGdbhRwGeomService iTGdbhRwGeomService;
 
     public RequestResult gdbhAnalysisHandle(String rwBsm) {
         QueryWrapper<GdbhDto> wrapper0_1 = new QueryWrapper<>();
@@ -49,6 +50,10 @@ public class GdbhJgService {
             return RequestResult.error("未查询到数据");
         }
 
+        Map<String, Object> retd0 = iTGdbhRwGeomService.sumTGdbhRwGeomByRwbsm(gdbhDto.getBsm());
+        String ewkt = (String) retd0.get("geom");
+        gdbhDto.setGeom(ewkt);
+
         //计算1 模型
         QueryWrapper<GdbhRwMxDto> wrapper0_2 = new QueryWrapper<>();
         wrapper0_2.eq("rwbsm", rwBsm);
@@ -219,44 +224,14 @@ public class GdbhJgService {
             ret.add(mxMap);
         }
 
-        String d_RawTableName = gdbhDto.getXzfwTbaleName();
 
-        //查询tableid
-        String tableId = gdbhDto.getXzfwTbaleId();
-        AjaxResult ajaxResult = tableFiledRelationService.QueryTableFiledRelation(tableId);
-        if (!ajaxResult.isSuccess()) {
-            return null;
-        }
-        Object tableStr = ajaxResult.get(AjaxResult.DATA_TAG);
-        ApiTTable tTable = JSON.parseObject(JSON.toJSONString(tableStr), ApiTTable.class);
+//        @Resource
+//        private ITGdbhRwGeomService iTGdbhRwGeomService;
 
-        List<String> ids = new ArrayList<>();
-        ids.add(id);
 
-        List<ApiTTableFiled> filedList = tTable.getTableFiledlist();
-        List<String> columns = new ArrayList<>(); // 列名
-        for (ApiTTableFiled filed : filedList) {
-            columns.add(filed.getFiledName());
-        }
-        RawTableVo d0_vo = new RawTableVo();
-        d0_vo.setIds(ids);
-        d0_vo.setSrid(4525);
-        d0_vo.setRawTableName(d_RawTableName);
-        d0_vo.setSiweiArea(true);
-        d0_vo.setIsGeography(false);
-        d0_vo.setColumns(columns);
-        Object objectData = httpAnalyseService.getHttpAnalyse(d0_vo);
         Map<String, Object> retMap = new HashMap<>();
         retMap.put("yzjg", ret);
-        if (objectData != null) {
-            List<Map> objectDataList = (List<Map>) objectData;
-            for (Map d_map_01 : objectDataList) {
-                d_map_01.put("siweiarea", NumberUtil.double2TwoDecimal(Double.parseDouble(d_map_01.get("siweiarea").toString())));
-            }
-            if (objectDataList != null && objectDataList.size() > 0) {
-                retMap.put("tbxx", objectDataList.get(0));
-            }
-        }
+        retMap.put("tbxx", iTGdbhRwGeomService.selectTGdbhRwGeomById(id));
         return RequestResult.success(retMap);
     }
 }

+ 3 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/gdbh/impl/GdbhServiceImpl.java

@@ -119,6 +119,9 @@ public class GdbhServiceImpl implements IGdbhService {
             String rebsm = StringUtils.getUUID();
             gdbhDto.setBsm(rebsm);
             gdbhDto = gdbhHandleService.AddGdbhYpGeom(gdbhDto.getXzfw(), gdbhDto.getYptype(), gdbhDto);
+            if (gdbhDto == null) {
+                return RequestResult.error("添加失败", null);
+            }
             gdbhDto.setStatus(1);
             gdbhDto.setRwzt(0);
             gdbhDto.setRwcjsj(new Date());

+ 9 - 0
onemap-modules/onemap-file/src/main/java/com/onemap/file/domain/TUploadGeomDTO.java

@@ -20,6 +20,7 @@ public class TUploadGeomDTO {
     private String geom;
     private Integer spotsnumber;
     private Double spotsarea;
+    private Double area;
     private Integer sridarea;
     private String fromroute;
     private Integer fromtype;
@@ -144,4 +145,12 @@ public class TUploadGeomDTO {
     public void settUploadGeomDetailsDTOList(List<TUploadGeomDetailsDTO> tUploadGeomDetailsDTOList) {
         this.tUploadGeomDetailsDTOList = tUploadGeomDetailsDTOList;
     }
+
+    public Double getArea() {
+        return area;
+    }
+
+    public void setArea(Double area) {
+        this.area = area;
+    }
 }

+ 2 - 1
onemap-modules/onemap-file/src/main/java/com/onemap/file/service/impl/SpaceFileRecordServiceImpl.java

@@ -362,6 +362,7 @@ public class SpaceFileRecordServiceImpl implements ISpaceFileRecordService {
         if (dto == null) {
             return null;
         }
+        dto.setArea(dto.getSpotsarea());
         if (isDetail != null && isDetail == 1) {
             TUploadGeomDetailsDTO uploadGeomDetailsDTO = new TUploadGeomDetailsDTO();
             uploadGeomDetailsDTO.setUploadId(dto.getId());
@@ -409,7 +410,7 @@ public class SpaceFileRecordServiceImpl implements ISpaceFileRecordService {
         }
         String pngPath = "/temp/" + StringUtils.getUUID() + ".png";
         try {
-            if (new File(tifPath).exists()){
+            if (new File(tifPath).exists()) {
                 FileUtils.TifToPng(tifPath, uploadFilePath + pngPath);
 //                String base64 = FileUtils.convertImageToBase64Str(tifPath);
                 double[] doubles = TifUtils.readTifEnvelopeTransformWGS84(tifPath);