|
@@ -1,8 +1,11 @@
|
|
|
package com.siwei.apply.controller;
|
|
|
|
|
|
-import com.siwei.apply.domain.Gyjsydscdj;
|
|
|
+import com.siwei.apply.domain.res.GyjsydscdjRes;
|
|
|
+import com.siwei.apply.domain.vo.GyjsydscdjUpdateVo;
|
|
|
+import com.siwei.apply.domain.vo.GyjsydscdjVo;
|
|
|
import com.siwei.apply.service.GyjsydscdjService;
|
|
|
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,19 +19,21 @@ import java.util.Map;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/gyjsydscdj")
|
|
|
-public class GyjsydscdjController {
|
|
|
+public class GyjsydscdjController extends BaseController {
|
|
|
@Autowired
|
|
|
private GyjsydscdjService gyjsydscdjService;
|
|
|
|
|
|
/**
|
|
|
- * 添加国有建设用地使用权首次登记记录
|
|
|
- *
|
|
|
- * @param gyjsydscdj
|
|
|
+ * 添加国有建设用地使用权首次登记
|
|
|
*/
|
|
|
@PostMapping()
|
|
|
- public R<Map> add(@RequestBody Gyjsydscdj gyjsydscdj) {
|
|
|
+ public R<Map> Add(@RequestBody GyjsydscdjVo gyjsydscdjVo) {
|
|
|
try {
|
|
|
- String id = gyjsydscdjService.add(gyjsydscdj);
|
|
|
+ Boolean b = gyjsydscdjService.isExit(gyjsydscdjVo.getProjectId());
|
|
|
+ if (b == true) {
|
|
|
+ return R.fail("此项目已添加国有建设用地使用权首次登记");
|
|
|
+ }
|
|
|
+ String id = gyjsydscdjService.add(gyjsydscdjVo);
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("id", id);
|
|
|
return R.ok(map);
|
|
@@ -38,30 +43,30 @@ public class GyjsydscdjController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据ID获取国有建设用地使用权首次登记记录
|
|
|
+ * 获取国有建设用地使用权首次登记
|
|
|
*
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
+ * @param projectId 项目ID
|
|
|
+ * @return 国有建设用地使用权首次登记
|
|
|
*/
|
|
|
- @GetMapping()
|
|
|
- public R<Gyjsydscdj> get(@PathVariable String id) {
|
|
|
+ @GetMapping("/{projectId}")
|
|
|
+ public R<GyjsydscdjRes> Get(@PathVariable String projectId) {
|
|
|
try {
|
|
|
- Gyjsydscdj gyjsydscdj = gyjsydscdjService.get(id);
|
|
|
- return R.ok(gyjsydscdj);
|
|
|
+ return R.ok(gyjsydscdjService.get(projectId));
|
|
|
} catch (Exception e) {
|
|
|
return R.fail(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 更新国有建设用地使用权首次登记记录
|
|
|
+ * 更新国有建设用地使用权首次登记
|
|
|
*
|
|
|
- * @param gyjsydscdj
|
|
|
+ * @param gyjsydscdjUpdateVo 国有建设用地使用权首次登记
|
|
|
+ * @return 操作结果
|
|
|
*/
|
|
|
@PutMapping()
|
|
|
- public R<Void> update(@RequestBody Gyjsydscdj gyjsydscdj) {
|
|
|
+ public R<Void> Update(@RequestBody GyjsydscdjUpdateVo gyjsydscdjUpdateVo) {
|
|
|
try {
|
|
|
- gyjsydscdjService.update(gyjsydscdj);
|
|
|
+ gyjsydscdjService.update(gyjsydscdjUpdateVo);
|
|
|
return R.ok();
|
|
|
} catch (Exception e) {
|
|
|
return R.fail(e.getMessage());
|