Sfoglia il codice sorgente

规划条件与用地红线

gushoubang 2 mesi fa
parent
commit
6494b834c1

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/GyjsydjfwscdjController.java

@@ -12,6 +12,7 @@ import java.util.Map;
 /**
  * 国有建设用地使用权及房屋所有权首次登记 控制器
  * 单独选址第八步
+ * 批次跑批第七步
  */
 @RestController
 @RequestMapping("/gyjsydjfwscdj")

+ 2 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/GyjsydscdjController.java

@@ -11,7 +11,8 @@ import java.util.Map;
 
 /**
  * 国有建设用地使用权首次登记 控制器
- * 单独选址第第四部步
+ * 单独选址第四步
+ * 批次跑批第三步
  */
 @RestController
 @RequestMapping("/gyjsydscdj")

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

@@ -12,6 +12,7 @@ import java.util.Map;
 /**
  * 建设工程规划许可 控制器
  * 单独选址第六步
+ * 批次报批第五步
  */
 @RestController
 @RequestMapping("/jsgcghxk")

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

@@ -12,6 +12,7 @@ import java.util.Map;
 /**
  * 建设用地规划许可 控制器
  * 单独选址第五步
+ * 批次报批第四步
  */
 @RestController
 @RequestMapping("/jsydghxk")

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

@@ -12,6 +12,7 @@ import java.util.Map;
 /**
  * 土地供应 控制器
  * 单独选址第三步
+ * 批次跑批第二步
  */
 @RestController
 @RequestMapping("/tdgy")

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/TdhyhsController.java

@@ -12,6 +12,7 @@ import java.util.Map;
 /**
  * 土地核验与规划核实 控制器
  * 单独选址第七步
+ * 批次跑批第六步
  */
 @RestController
 @RequestMapping("/tdhyhs")

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

@@ -0,0 +1,62 @@
+package com.siwei.apply.controller;
+
+import com.siwei.apply.domain.Tjyydhx;
+import com.siwei.apply.service.TjyydhxService;
+import com.siwei.common.core.domain.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 规划条件与用地红线出具 控制器
+ * 批次报批第一步
+ */
+@RestController
+@RequestMapping("/tjyydhx")
+public class TjyydhxController {
+    @Autowired
+    private TjyydhxService tjyydhxService;
+
+    /**
+     * 添加规划条件与用地红线出具信息
+     */
+    @PostMapping()
+    public R<Map> add(@RequestBody Tjyydhx tjyydhx) {
+        try {
+            String id = tjyydhxService.add(tjyydhx);
+            Map<String, String> map = new HashMap<>();
+            map.put("id", id);
+            return R.ok(map);
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+    }
+
+    /**
+     * 根据 ID 获取规划条件与用地红线出具信息
+     */
+    @GetMapping("/{id}")
+    public R<Tjyydhx> get(@PathVariable("id") String id) {
+        try {
+            Tjyydhx tjyydhx = tjyydhxService.get(id);
+            return R.ok(tjyydhx);
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+    }
+
+    /**
+     * 更新规划条件与用地红线出具信息
+     */
+    @PutMapping()
+    public R<Void> update(@RequestBody Tjyydhx tjyydhx) {
+        try {
+            tjyydhxService.update(tjyydhx);
+            return R.ok();
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+    }
+}

+ 34 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Tjyydhx.java

@@ -0,0 +1,34 @@
+package com.siwei.apply.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.UUID;
+
+/**
+ * 规划条件与用地红线出具对象 tjyydhx
+ */
+@Data
+public class Tjyydhx {
+    private String id;
+    private String projectId;      // 项目ID
+    private String dkbm;           // 地块编码
+    private Float area;            // 用地面积
+    private String ydxz;           // 用地性质
+    private String ydwz;           // 用地位置
+    private String cjbh;           // 出具编号
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date cjDate;           // 出具日期
+    private String cjyj;           // 出具意见
+    private String creatorId;      // 创建人ID
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createdAt;        // 创建时间
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updatedAt;        // 更新时间
+
+    public void generateId() {
+        this.id = UUID.randomUUID().toString();
+    }
+}

+ 34 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/TjyydhxMapper.java

@@ -0,0 +1,34 @@
+package com.siwei.apply.mapper;
+
+import com.siwei.apply.domain.Tjyydhx;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 规划条件与用地红线出具 Mapper 接口
+ */
+@Mapper
+public interface TjyydhxMapper {
+
+    /**
+     * 添加规划条件与用地红线出具记录
+     *
+     * @param tjyydhx 实体
+     */
+    void add(Tjyydhx tjyydhx);
+
+    /**
+     * 根据ID获取规划条件与用地红线出具记录
+     *
+     * @param id 主键ID
+     * @return Tjyydhx 对象
+     */
+    Tjyydhx get(@Param("id") String id);
+
+    /**
+     * 更新规划条件与用地红线出具记录
+     *
+     * @param tjyydhx 实体
+     */
+    void update(Tjyydhx tjyydhx);
+}

+ 31 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/TjyydhxService.java

@@ -0,0 +1,31 @@
+package com.siwei.apply.service;
+
+import com.siwei.apply.domain.Tjyydhx;
+
+/**
+ * 规划条件与用地红线出具 服务接口
+ */
+public interface TjyydhxService {
+    /**
+     * 添加规划条件与用地红线出具记录
+     *
+     * @param tjyydhx Tjyydhx 对象
+     * @return 插入记录的ID
+     */
+    String add(Tjyydhx tjyydhx);
+
+    /**
+     * 根据 ID 获取规划条件与用地红线出具信息
+     *
+     * @param id 主键
+     * @return Tjyydhx 对象
+     */
+    Tjyydhx get(String id);
+
+    /**
+     * 更新规划条件与用地红线出具信息
+     *
+     * @param tjyydhx Tjyydhx 对象
+     */
+    void update(Tjyydhx tjyydhx);
+}

+ 37 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/TjyydhxImpl.java

@@ -0,0 +1,37 @@
+package com.siwei.apply.service.impl;
+
+import com.siwei.apply.domain.Tjyydhx;
+import com.siwei.apply.mapper.TjyydhxMapper;
+import com.siwei.apply.service.TjyydhxService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import static com.siwei.apply.common.Common.UserId;
+
+/**
+ * 规划条件与用地红线出具 服务实现类
+ */
+@Service
+public class TjyydhxImpl implements TjyydhxService {
+
+    @Autowired
+    private TjyydhxMapper tjyydhxMapper;
+
+    @Override
+    public String add(Tjyydhx tjyydhx) {
+        tjyydhx.generateId();
+        tjyydhx.setCreatorId(UserId);
+        tjyydhxMapper.add(tjyydhx);
+        return tjyydhx.getId();
+    }
+
+    @Override
+    public Tjyydhx get(String id) {
+        return tjyydhxMapper.get(id);
+    }
+
+    @Override
+    public void update(Tjyydhx tjyydhx) {
+        tjyydhxMapper.update(tjyydhx);
+    }
+}

+ 55 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/TjyydhxMapper.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.siwei.apply.mapper.TjyydhxMapper">
+
+    <resultMap id="TjyydhxResultMap" type="com.siwei.apply.domain.Tjyydhx">
+        <id property="id" column="id"/>
+        <result property="projectId" column="project_id"/>
+        <result property="dkbm" column="dkbm"/>
+        <result property="area" column="area"/>
+        <result property="ydxz" column="ydxz"/>
+        <result property="ydwz" column="ydwz"/>
+        <result property="cjbh" column="cjbh"/>
+        <result property="cjDate" column="cj_date"/>
+        <result property="cjyj" column="cjyj"/>
+        <result property="creatorId" column="creator_id"/>
+        <result property="createdAt" column="created_at"/>
+        <result property="updatedAt" column="updated_at"/>
+    </resultMap>
+
+    <!-- 添加记录 -->
+    <insert id="add" parameterType="com.siwei.apply.domain.Tjyydhx">
+        INSERT INTO tjyydhx (id, project_id, dkbm, area, ydxz, ydwz,
+                             cjbh, cj_date, cjyj, creator_id, created_at, updated_at)
+        VALUES (#{id}, #{projectId}, #{dkbm}, #{area}, #{ydxz}, #{ydwz},
+                #{cjbh}, #{cjDate}, #{cjyj}, #{creatorId}, now(), now())
+    </insert>
+
+    <!-- 根据ID获取记录 -->
+    <select id="get" resultMap="TjyydhxResultMap" parameterType="String">
+        SELECT *
+        FROM tjyydhx
+        WHERE id = #{id}
+    </select>
+
+    <!-- 根据ID更新记录 -->
+    <update id="update" parameterType="com.siwei.apply.domain.Tjyydhx">
+        UPDATE tjyydhx
+        <set>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="dkbm != null">dkbm = #{dkbm},</if>
+            <if test="area != null">area = #{area},</if>
+            <if test="ydxz != null">ydxz = #{ydxz},</if>
+            <if test="ydwz != null">ydwz = #{ydwz},</if>
+            <if test="cjbh != null">cjbh = #{cjbh},</if>
+            <if test="cjDate != null">cj_date = #{cjDate},</if>
+            <if test="cjyj != null">cjyj = #{cjyj},</if>
+            updated_at = now()
+        </set>
+        WHERE id = #{id}
+    </update>
+
+</mapper>