|
@@ -1,8 +1,11 @@
|
|
|
package com.siwei.apply.controller;
|
|
|
|
|
|
-import com.siwei.apply.domain.Gyjsydjfwscdj;
|
|
|
+import com.siwei.apply.domain.res.GyjsydjfwscdjRes;
|
|
|
+import com.siwei.apply.domain.vo.GyjsydjfwscdjUpdateVo;
|
|
|
+import com.siwei.apply.domain.vo.GyjsydjfwscdjVo;
|
|
|
import com.siwei.apply.service.GyjsydjfwscdjService;
|
|
|
import com.siwei.common.core.domain.R;
|
|
|
+import com.siwei.common.core.web.controller.BaseController;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -16,17 +19,21 @@ import java.util.Map;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/gyjsydjfwscdj")
|
|
|
-public class GyjsydjfwscdjController {
|
|
|
+public class GyjsydjfwscdjController extends BaseController {
|
|
|
@Autowired
|
|
|
private GyjsydjfwscdjService gyjsydjfwscdjService;
|
|
|
|
|
|
/**
|
|
|
- * 添加登记信息
|
|
|
+ * 添加国有建设用地使用权及房屋所有权首次登记
|
|
|
*/
|
|
|
@PostMapping()
|
|
|
- public R<Map> add(@RequestBody Gyjsydjfwscdj gyjsydjfwscdj) {
|
|
|
+ public R<Map> Add(@RequestBody GyjsydjfwscdjVo gyjsydjfwscdjVo) {
|
|
|
try {
|
|
|
- String id = gyjsydjfwscdjService.add(gyjsydjfwscdj);
|
|
|
+ Boolean b = gyjsydjfwscdjService.isExit(gyjsydjfwscdjVo.getProjectId());
|
|
|
+ if (b == true) {
|
|
|
+ return R.fail("此项目已添加国有建设用地使用权及房屋所有权首次登记");
|
|
|
+ }
|
|
|
+ String id = gyjsydjfwscdjService.add(gyjsydjfwscdjVo);
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("id", id);
|
|
|
return R.ok(map);
|
|
@@ -36,25 +43,30 @@ public class GyjsydjfwscdjController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据 ID 获取登记信息
|
|
|
+ * 获取国有建设用地使用权及房屋所有权首次登记
|
|
|
+ *
|
|
|
+ * @param projectId 项目ID
|
|
|
+ * @return 国有建设用地使用权及房屋所有权首次登记
|
|
|
*/
|
|
|
- @GetMapping("/{id}")
|
|
|
- public R<Gyjsydjfwscdj> get(@PathVariable("id") String id) {
|
|
|
+ @GetMapping("/{projectId}")
|
|
|
+ public R<GyjsydjfwscdjRes> Get(@PathVariable String projectId) {
|
|
|
try {
|
|
|
- Gyjsydjfwscdj gyjsydjfwscdj = gyjsydjfwscdjService.get(id);
|
|
|
- return R.ok(gyjsydjfwscdj);
|
|
|
+ return R.ok(gyjsydjfwscdjService.get(projectId));
|
|
|
} catch (Exception e) {
|
|
|
return R.fail(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 更新登记信息
|
|
|
+ * 更新国有建设用地使用权及房屋所有权首次登记
|
|
|
+ *
|
|
|
+ * @param gyjsydjfwscdjUpdateVo 国有建设用地使用权及房屋所有权首次登记
|
|
|
+ * @return 操作结果
|
|
|
*/
|
|
|
@PutMapping()
|
|
|
- public R<Void> update(@RequestBody Gyjsydjfwscdj gyjsydjfwscdj) {
|
|
|
+ public R<Void> Update(@RequestBody GyjsydjfwscdjUpdateVo gyjsydjfwscdjUpdateVo) {
|
|
|
try {
|
|
|
- gyjsydjfwscdjService.update(gyjsydjfwscdj);
|
|
|
+ gyjsydjfwscdjService.update(gyjsydjfwscdjUpdateVo);
|
|
|
return R.ok();
|
|
|
} catch (Exception e) {
|
|
|
return R.fail(e.getMessage());
|