123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- package com.siwei.apply.controller;
- import com.siwei.apply.domain.res.TdhyhsRes;
- import com.siwei.apply.domain.vo.TdhyhsUpdateVo;
- import com.siwei.apply.domain.vo.TdhyhsVo;
- import com.siwei.apply.service.TdhyhsService;
- 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.*;
- import java.util.HashMap;
- import java.util.Map;
- /**
- * 土地核验与规划核实 控制器
- * 单独选址第七步
- * 批次跑批第六步
- */
- @RestController
- @RequestMapping("/tdhyhs")
- public class TdhyhsController extends BaseController {
- @Autowired
- private TdhyhsService tdhyhsService;
- /**
- * 添加土地核验与规划核实
- */
- @PostMapping()
- public R<Map> Add(@RequestBody TdhyhsVo tdhyhsVo) {
- try {
- // Boolean b = tdhyhsService.isExit(tdhyhsVo.getProjectId());
- // if (b == true) {
- // return R.fail("此项目已添加土地核验与规划核实");
- // }
- String id = tdhyhsService.add(tdhyhsVo);
- Map<String, String> map = new HashMap<>();
- map.put("id", id);
- return R.ok(map);
- } catch (Exception e) {
- return R.fail(e.getMessage());
- }
- }
- /**
- * 获取土地核验与规划核实
- *
- * @param projectId 项目ID
- * @return 土地核验与规划核实
- */
- @GetMapping("/{projectId}")
- public R<TdhyhsRes> Get(@PathVariable String projectId) {
- try {
- return R.ok(tdhyhsService.get(projectId));
- } catch (Exception e) {
- return R.fail(e.getMessage());
- }
- }
- /**
- * 更新土地核验与规划核实
- *
- * @param tdhyhsUpdateVo 土地核验与规划核实
- * @return 操作结果
- */
- @PutMapping()
- public R<Void> Update(@RequestBody TdhyhsUpdateVo tdhyhsUpdateVo) {
- try {
- tdhyhsService.update(tdhyhsUpdateVo);
- return R.ok();
- } catch (Exception e) {
- return R.fail(e.getMessage());
- }
- }
- /**
- * 更新土地核验与规划核实的上链状态
- */
- @PutMapping("/onchain")
- public R<Void> updateHasOnchain(@RequestBody Map<String, Object> params) {
- try {
- String id = (String) params.get("id");
- Boolean hasOnchain = (Boolean) params.get("hasOnchain");
- tdhyhsService.updateHasOnchain(id, hasOnchain);
- return R.ok();
- } catch (Exception e) {
- return R.fail(e.getMessage());
- }
- }
- }
|