Browse Source

1、修正监测建设用地的告警逻辑,有原先的默认监测值大于等于规划值位正常,改为监测值小于规划值为正常
2、修正风险因子年接口,由原先的默认拼接行政区号改为拼接行政区前4位+00的方式,因为发现数据库中,一个市的数据存在一个库中,不存在市下级行政区单独存库的情况

Gogs 5 months ago
parent
commit
375663e85e

+ 3 - 0
onemap-common/onemap-common-core/src/main/java/com/onemap/common/core/utils/GHSSHelper.java

@@ -43,6 +43,9 @@ public class GHSSHelper {
             case ">=":
                 s = (xzz >= ghz ? "正常" : "预警");
                 break;
+            case "<":
+                s = (xzz < ghz ? "正常" : "预警");
+                break;
             case "-":
                 s = (xzz - ghz > 0 ? "增加" : (xzz - ghz == 0 ? "无变化" : "降低"));
                 break;

+ 4 - 1
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/PythonExecute.java

@@ -8,6 +8,8 @@ import org.python.core.PyObject;
 import org.python.core.PyString;
 import org.python.core.PyType;
 import org.python.util.PythonInterpreter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
@@ -18,7 +20,7 @@ import java.util.*;
 
 @Component
 public class PythonExecute {
-
+    private static final Logger log = LoggerFactory.getLogger(PythonExecute.class);
     /**
      * python.exe位置
      */
@@ -70,6 +72,7 @@ public class PythonExecute {
         JSONObject json = new JSONObject(params);
         String[] arguments = new String[]{pythonexe, pythonfile, functionName, Base64Utils.base64Encode(json.toJSONString())};
         try {
+            log.info("python执行参数:{}", arguments[3]);
             Process process = Runtime.getRuntime().exec(arguments);
             BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
             String line = null;

+ 5 - 3
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fxpj/CtfxServiceImpl.java

@@ -85,8 +85,10 @@ public class CtfxServiceImpl implements CtfxService {
         wrapper.like("id", bsm);
         TCtfxYzDTO tCtfxYzDTO = tCtfxYzMapper.selectOne(wrapper);
         if (tCtfxYzDTO != null) {
-            String sjlx = tCtfxYzDTO.getSjlx();
-            sjlx += "_" + StringUtils.completionXzqdm(xzqdm) + "_";
+//            String sjlx = tCtfxYzDTO.getSjlx();
+//            sjlx += "_" + StringUtils.completionXzqdm(xzqdm) + "_";
+            // 目前查看数据库,每个市的数在一个库里,暂时改为下面的方式
+            String sjlx = String.format("%s_%s00_", tCtfxYzDTO.getSjlx(), xzqdm.substring(0, 4));
             List<String> yearlist = tCtfxYzMapper.getFxyzYear(sjlx);
             if (yearlist.size() > 0) {
                 List<Map<String, String>> data = new ArrayList<>();
@@ -127,7 +129,7 @@ public class CtfxServiceImpl implements CtfxService {
             mainDto.setFxtable("SDE." + mainDto.getFxtable());
             mainDto.setSjy(sjy.getTablename());
         }
-        if ("7".equals(mainDto.getSsmk())){
+        if ("7".equals(mainDto.getSsmk())) {
             mainDto.setFxtable("SDE." + mainDto.getFxtable());
         }
         tCtfxMainMapper.insert(mainDto);

+ 10 - 4
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/ghss/ZbmxJcpgyjServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class ZbmxJcpgyjServiceImpl implements IZbmxJcpgyjService {
@@ -240,7 +241,8 @@ public class ZbmxJcpgyjServiceImpl implements IZbmxJcpgyjService {
             List<ZbmxJcpgyjDTO> jcz = zbmxJcpgyjMapper.SelectJCZ(newidsList, page.getXzqdm(), page.getYear());
             //规划值
             List<ZbmxJcpgyjDTO> ghz = zbmxJcpgyjMapper.SelectGHZ(newidsList, page.getXzqdm());
-
+            // 城市监测用地特殊处理, 101006 城市监测用地bsm
+            String symbol = "101006".equals(page.getTxbsm())  ? "<" : ">=";
             for (ZbmxJcpgyjViewDTO item : dataZB) {
 
                 ZbmxJcpgyjDTO b = GetJcpgyjClass(jcz, item.getZbbh());
@@ -257,9 +259,13 @@ public class ZbmxJcpgyjServiceImpl implements IZbmxJcpgyjService {
                 if (c != null) {
                     item.setGhmbz(new KeyValuePair().init(c.key, c.value != null ? c.value.toString() + c.dw : null));
                 }
-
-                item.setStatus(GHSSHelper.RarlyWarning(b.value == null ? 0 : b.value, c.value == null ? 0 : c.value, ">="));
-
+                String status = GHSSHelper.RarlyWarning(b.value == null ? 0 : b.value, c.value == null ? 0 : c.value, symbol);
+                item.setStatus(status);
+            }
+            String status = page.getStatus();
+            if (status != null && !(status = status.trim()).isEmpty()) {
+                String flag = "0".equals(status) ? "预警" : "正常";
+                return   dataZB.stream().filter(item -> flag.equals(item.getStatus())).collect(Collectors.toList());
             }
             return dataZB;
         } catch (Exception e) {