Bladeren bron

调整关于上链及资源码获取

chenendian 3 weken geleden
bovenliggende
commit
8d423e9960

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/JsydghxkController.java

@@ -8,6 +8,7 @@ import com.siwei.apply.service.JsydghxkService;
 import com.siwei.apply.service.NodeLandService;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -98,6 +99,9 @@ public class JsydghxkController extends BaseController {
         try {
             String id = (String) params.get("id");
             Boolean hasOnchain = (Boolean) params.get("hasOnchain");
+            if (StringUtils.isBlank(id)) {
+                return R.fail("nodeId不能为空");
+            }
             NodeLand nodeLand = nodeLandService.getNodeLandByNodeId(id);
             if(Objects.isNull(nodeLand)){
                 return R.fail(502,"数据空间信息不存在,请检查先导入空间数据");

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/TdgyController.java

@@ -9,6 +9,7 @@ import com.siwei.apply.service.NodeLandService;
 import com.siwei.apply.service.TdgyService;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -112,6 +113,9 @@ public class TdgyController extends BaseController {
         try {
             String id = (String) params.get("id");
             Boolean hasOnchain = (Boolean) params.get("hasOnchain");
+            if (StringUtils.isBlank(id)) {
+                return R.fail("nodeId不能为空");
+            }
             NodeLand nodeLand = nodeLandService.getNodeLandByNodeId(id);
             if(Objects.isNull(nodeLand)){
                 return R.fail(502,"数据空间信息不存在,请检查先导入空间数据");

+ 5 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/TjyydhxController.java

@@ -6,6 +6,7 @@ import com.siwei.apply.domain.vo.TjyydhxVo;
 import com.siwei.apply.service.TjyydhxService;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -92,6 +93,10 @@ public class TjyydhxController extends BaseController {
         try {
             String id = (String) params.get("id");
             Boolean hasOnchain = (Boolean) params.get("hasOnchain");
+            if (StringUtils.isBlank(id)) {
+                return R.fail("nodeId不能为空");
+            }
+
             tjyydhxService.updateHasOnchain(id, hasOnchain);
             return R.ok();
         } catch (Exception e) {

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/YdbpController.java

@@ -8,6 +8,7 @@ import com.siwei.apply.service.NodeLandService;
 import com.siwei.apply.service.YdbpService;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -96,6 +97,9 @@ public class YdbpController extends BaseController {
         try {
             String id = (String) params.get("id");
             Boolean hasOnchain = (Boolean) params.get("hasOnchain");
+            if (StringUtils.isBlank(id)) {
+                return R.fail("nodeId不能为空");
+            }
             NodeLand nodeLand = nodeLandService.getNodeLandByNodeId(id);
             if(Objects.isNull(nodeLand)){
                 return R.fail(502,"数据空间信息不存在,请检查先导入空间数据");

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/YdysyxzController.java

@@ -8,6 +8,7 @@ import com.siwei.apply.service.NodeLandService;
 import com.siwei.apply.service.YdysyxzService;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -98,6 +99,9 @@ public class YdysyxzController extends BaseController {
         try {
             String id = (String) params.get("id");
             Boolean hasOnchain = (Boolean) params.get("hasOnchain");
+            if (StringUtils.isBlank(id)) {
+                return R.fail("nodeId不能为空");
+            }
             NodeLand nodeLand = nodeLandService.getNodeLandByNodeId(id);
             if(Objects.isNull(nodeLand)){
                 return R.fail(502,"数据空间信息不存在,请检查先导入空间数据");

+ 15 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/LandOneCodeServiceImpl.java

@@ -9,6 +9,7 @@ import com.siwei.apply.mapper.*;
 import com.siwei.apply.service.LandOneCodeService;
 import com.siwei.common.core.utils.bean.BeanUtils;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -247,12 +248,24 @@ public class LandOneCodeServiceImpl implements LandOneCodeService {
         String projectId = projectWorkflow.getProjectId();
         Project project =projectMapper.get(projectId);
         Integer projectType = project.getProjectType();
-
         // 获取地块ID
         NodeLand nodeLand = nodeLandMapper.selectByNodeId(nodeId);
+        if(Objects.isNull(nodeLand)){
+            String nodeTableName = "t_tjyydhx";
+            if(ProjectType.ALONE.getCode().equals(projectType)){
+                nodeTableName = "t_ydbp";
+            }
+            //获取当前项目下的固定节点
+            List<ProjectWorkflow>  useProjectWorkflowList =  projectWorkflowMapper.selectProjectOneNodeId(nodeId,nodeTableName);
+            if(CollectionUtils.isNotEmpty(useProjectWorkflowList) && Objects.nonNull(useProjectWorkflowList.get(0))){
+                String useNodeId = useProjectWorkflowList.get(0).getNodeId();
+                nodeLand = nodeLandMapper.selectByNodeId(useNodeId);
+            }
+            logger.info("未找到项目----固定节点对应的地块信息,nodeId={}", nodeId);
+        }
+
         if(Objects.isNull(nodeLand)){
             logger.error("未找到节点对应的地块信息,nodeId={}", nodeId);
-            //throw new RuntimeException("未找到节点对应的地块信息");
             return nodeId;
         }