Selaa lähdekoodia

修改返回结构

gushoubang 2 kuukautta sitten
vanhempi
commit
5b43a5a5a3

+ 3 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/JsgcghxkController.java

@@ -46,13 +46,13 @@ public class JsgcghxkController extends BaseController {
     }
 
     /**
-     * 获取建设工程规划许可列表
+     * 获取建设工程规划许可信息
      *
      * @param projectId 项目ID
-     * @return 建设工程规划许可列表
+     * @return 建设工程规划许可信息
      */
     @GetMapping("/{projectId}")
-    public R<List<JsgcghxkRes>> Get(@PathVariable String projectId) {
+    public R<JsgcghxkRes> Get(@PathVariable String projectId) {
         try {
             return R.ok(jsgcghxkService.get(projectId));
         } catch (Exception e) {

+ 5 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/res/JsgcghxkRes.java

@@ -3,11 +3,15 @@ package com.siwei.apply.domain.res;
 import com.siwei.apply.domain.Jsgcghxk;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * 建设工程规划许可 结果对象
  */
 @Data
-public class JsgcghxkRes extends Jsgcghxk {
+public class JsgcghxkRes {
+    String projectId; // 项目ID
     String projectName;// 项目名称
     String projectCode;// 项目代码
+    List<Jsgcghxk> jsgcghxkList; // 规划许可列表
 }

+ 3 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/JsgcghxkService.java

@@ -24,12 +24,12 @@ public interface JsgcghxkService {
     String add(JsgcghxkVo jsgcghxkVo);
 
     /**
-     * 获取建设工程规划许可信息列表
+     * 获取建设工程规划许可信息
      *
      * @param projectId 项目ID
-     * @return 建设工程规划许可结果对象列表
+     * @return 建设工程规划许可结果对象
      */
-    List<JsgcghxkRes> get(String projectId);
+    JsgcghxkRes get(String projectId);
 
     /**
      * 更新建设工程规划许可信息

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/GyjsydjfwscdjImpl.java

@@ -45,7 +45,10 @@ public class GyjsydjfwscdjImpl implements GyjsydjfwscdjService {
         Project project = projectMapper.get(projectId);
 
         GyjsydjfwscdjRes gyjsydjfwscdjRes = new GyjsydjfwscdjRes();
-        BeanUtils.copyProperties(gyjsydjfwscdj, gyjsydjfwscdjRes);
+        if(gyjsydjfwscdj != null){
+            BeanUtils.copyProperties(gyjsydjfwscdj, gyjsydjfwscdjRes);
+        }
+        gyjsydjfwscdjRes.setProjectId(projectId);
         gyjsydjfwscdjRes.setProjectName(project.getName());
         gyjsydjfwscdjRes.setProjectCode(project.getCode());
         return gyjsydjfwscdjRes;

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/GyjsydscdjImpl.java

@@ -45,7 +45,10 @@ public class GyjsydscdjImpl implements GyjsydscdjService {
         Project project = projectMapper.get(projectId);
 
         GyjsydscdjRes gyjsydscdjRes = new GyjsydscdjRes();
-        BeanUtils.copyProperties(gyjsydscdj, gyjsydscdjRes);
+        if(gyjsydscdj != null){
+            BeanUtils.copyProperties(gyjsydscdj, gyjsydscdjRes);
+        }
+        gyjsydscdjRes.setProjectId(projectId);
         gyjsydscdjRes.setProjectName(project.getName());
         gyjsydscdjRes.setProjectCode(project.getCode());
         return gyjsydscdjRes;

+ 8 - 10
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/JsgcghxkServiceImpl.java

@@ -43,19 +43,17 @@ public class JsgcghxkServiceImpl implements JsgcghxkService {
     }
 
     @Override
-    public List<JsgcghxkRes> get(String projectId) {
+    public JsgcghxkRes get(String projectId) {
         List<Jsgcghxk> jsgcghxkList = jsgcghxkMapper.get(projectId);
         Project project = projectMapper.get(projectId);
 
-        List<JsgcghxkRes> jsgcghxkResList = new ArrayList<>();
-        for (Jsgcghxk jsgcghxk : jsgcghxkList) {
-            JsgcghxkRes jsgcghxkRes = new JsgcghxkRes();
-            BeanUtils.copyProperties(jsgcghxk, jsgcghxkRes);
-            jsgcghxkRes.setProjectName(project.getName());
-            jsgcghxkRes.setProjectCode(project.getCode());
-            jsgcghxkResList.add(jsgcghxkRes);
-        }
-        return jsgcghxkResList;
+        JsgcghxkRes jsgcghxkRes = new JsgcghxkRes();
+        jsgcghxkRes.setProjectId(projectId);
+        jsgcghxkRes.setProjectName(project.getName());
+        jsgcghxkRes.setProjectCode(project.getCode());
+        jsgcghxkRes.setJsgcghxkList(jsgcghxkList);
+
+        return jsgcghxkRes;
     }
 
     @Override

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/JsydghxkImpl.java

@@ -45,7 +45,10 @@ public class JsydghxkImpl implements JsydghxkService {
         Project project = projectMapper.get(projectId);
 
         JsydghxkRes jsydghxkRes = new JsydghxkRes();
-        BeanUtils.copyProperties(jsydghxk, jsydghxkRes);
+        if(jsydghxk != null){
+            BeanUtils.copyProperties(jsydghxk, jsydghxkRes);
+        }
+        jsydghxkRes.setProjectId(projectId);
         jsydghxkRes.setProjectName(project.getName());
         jsydghxkRes.setProjectCode(project.getCode());
         return jsydghxkRes;

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/TdgyImpl.java

@@ -45,7 +45,10 @@ public class TdgyImpl implements TdgyService {
         Project project = projectMapper.get(projectId);
 
         TdgyRes tdgyRes = new TdgyRes();
-        BeanUtils.copyProperties(tdgy, tdgyRes);
+        if(tdgy != null){
+            BeanUtils.copyProperties(tdgy, tdgyRes);
+        }
+        tdgyRes.setProjectId(projectId);
         tdgyRes.setProjectName(project.getName());
         tdgyRes.setProjectCode(project.getCode());
         return tdgyRes;

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/TdhyhsImpl.java

@@ -45,7 +45,10 @@ public class TdhyhsImpl implements TdhyhsService {
         Project project = projectMapper.get(projectId);
 
         TdhyhsRes tdhyhsRes = new TdhyhsRes();
-        BeanUtils.copyProperties(tdhyhs, tdhyhsRes);
+        if(tdhyhs != null){
+            BeanUtils.copyProperties(tdhyhs, tdhyhsRes);
+        }
+        tdhyhsRes.setProjectId(projectId);
         tdhyhsRes.setProjectName(project.getName());
         tdhyhsRes.setProjectCode(project.getCode());
         return tdhyhsRes;

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/TjyydhxImpl.java

@@ -46,7 +46,10 @@ public class TjyydhxImpl implements TjyydhxService {
         Project project = projectMapper.get(projectId);
 
         TjyydhxRes tjyydhxRes = new TjyydhxRes();
-        BeanUtils.copyProperties(tjyydhx, tjyydhxRes);
+        if(tjyydhx != null){
+            BeanUtils.copyProperties(tjyydhx, tjyydhxRes);
+        }
+        tjyydhxRes.setProjectId(projectId);
         tjyydhxRes.setProjectName(project.getName());
         tjyydhxRes.setProjectCode(project.getCode());
         return tjyydhxRes;

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/YdbpImpl.java

@@ -45,7 +45,10 @@ public class YdbpImpl implements YdbpService {
         Project project = projectMapper.get(projectId);
 
         YdbpRes ydbpRes = new YdbpRes();
-        BeanUtils.copyProperties(ydbp, ydbpRes);
+        if(ydbp != null){
+            BeanUtils.copyProperties(ydbp, ydbpRes);
+        }
+        ydbpRes.setProjectId(projectId);
         ydbpRes.setProjectName(project.getName());
         ydbpRes.setProjectCode(project.getCode());
         ydbpRes.setProjectType(project.getProjectType());