chenendian 3 日 前
コミット
3dcaab2b8d

+ 55 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/GjShijiShouchu.java

@@ -0,0 +1,55 @@
+package com.siwei.apply.domain;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class GjShijiShouchu {
+
+    private Integer gid;
+
+    private String yqsdw;
+
+    private String scmj;
+
+    private String scjg;
+
+    private String scwh;
+
+    private String scsj;
+
+    private BigDecimal mj;
+
+    private String scfs;
+
+    private Double scnd;
+
+    private String tdzl;
+
+    private String ytdyt;
+
+    private String ytdsyqxz;
+
+    private String wzfbck;
+
+    private String bz;
+
+    private String bsm;
+
+    private String xzq;
+
+    private String dabh;
+
+    private BigDecimal shapeLeng;
+
+    private BigDecimal shapeArea;
+
+    private String xmmc;
+
+    private BigDecimal sccb;
+
+    private BigDecimal mjMu;
+
+    private String geom;
+}

+ 15 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/res/TrendStatisticsData.java

@@ -0,0 +1,15 @@
+package com.siwei.apply.domain.res;
+
+import lombok.Data;
+
+
+/**
+ * 项目概览响应类
+ * 用于展示项目的概览信息
+ */
+@Data
+public class TrendStatisticsData {
+    private String year; // 年份
+    private String inDataArea; //入库地块面积
+    private String outDataArea; //出库地块面积
+}

+ 25 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/GjShijiShouchuFilterVo.java

@@ -0,0 +1,25 @@
+package com.siwei.apply.domain.vo;
+
+import lombok.Data;
+
+@Data
+public class GjShijiShouchuFilterVo {
+
+    private String xmmc;
+
+    private String xzq;
+
+    private String scfs;
+
+    private String startDate;
+
+    private String endDate;
+
+    private Integer pageNum = 1;
+
+    private Integer pageSize = 10;
+
+    public Integer getOffset() {
+        return (pageNum - 1) * pageSize;
+    }
+}

+ 26 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/GjShijiShouchuMapper.java

@@ -0,0 +1,26 @@
+package com.siwei.apply.mapper;
+
+import com.siwei.apply.domain.GjShijiShouchu;
+import com.siwei.apply.domain.vo.GjShijiShouchuFilterVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface GjShijiShouchuMapper {
+
+    void add(GjShijiShouchu gjShijiShouchu);
+
+    GjShijiShouchu get(@Param("gid") Integer gid);
+
+    List<GjShijiShouchu> getList(GjShijiShouchuFilterVo filterVo);
+
+    Integer getCount(GjShijiShouchuFilterVo filterVo);
+
+    void update(GjShijiShouchu gjShijiShouchu);
+
+    void batchDelete(@Param("gids") List<Integer> gids);
+
+    List<GjShijiShouchu> getByGeomIntersects(@Param("ewkt") String ewkt);
+}

+ 75 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/StorageServiceImpl.java

@@ -0,0 +1,75 @@
+package com.siwei.apply.service.cadastre.impl;
+
+import com.siwei.apply.domain.GongdiJihua;
+import com.siwei.apply.domain.LandType;
+import com.siwei.apply.domain.cadastre.LandSupplyReportDTO;
+import com.siwei.apply.domain.res.*;
+import com.siwei.apply.domain.vo.GongdiJihuaFilterVo;
+import com.siwei.apply.domain.vo.LandSupplyProjectVO;
+import com.siwei.apply.domain.vo.LandSupplyReportVO;
+import com.siwei.apply.enums.LandUseTypeEnum;
+import com.siwei.apply.mapper.GongdiJihuaMapper;
+import com.siwei.apply.mapper.LandTypeMapper;
+import com.siwei.apply.mapper.TdgyMapper;
+import com.siwei.common.core.utils.StringUtils;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+@Service
+public class StorageServiceImpl {
+
+    @Autowired
+    private GongdiJihuaMapper gongdiJihuaMapper;
+
+    @Autowired
+    private TdgyMapper dgyMapper;
+
+    @Autowired
+    private LandTypeMapper landTypeMapper;
+
+
+
+
+    private LandSupplyReportDTO.CompletedDTO buildCompletedDTO(Double area, Integer count, Integer transfer, Integer allocation, Integer other) {
+        LandSupplyReportDTO.CompletedDTO completed = new LandSupplyReportDTO.CompletedDTO();
+        completed.setArea(area);
+        completed.setCount(count);
+        completed.setTransfer(transfer);
+        completed.setAllocation(allocation);
+        completed.setOther(other);
+        return completed;
+    }
+
+    private String convertCategory(String category) {
+        if (category == null || category.equals("未知")) {
+            return "其他";
+        }
+        return category;
+    }
+
+    private Double toDouble(Object value) {
+        if (value == null) {
+            return 0.0;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).doubleValue();
+        }
+        return 0.0;
+    }
+
+    private Integer toInteger(Object value) {
+        if (value == null) {
+            return 0;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).intValue();
+        }
+        return 0;
+    }
+}

+ 133 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/GjShijiShouchuMapper.xml

@@ -0,0 +1,133 @@
+<?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.GjShijiShouchuMapper">
+
+    <resultMap id="gjShijiShouchuMap" type="com.siwei.apply.domain.GjShijiShouchu">
+        <id column="gid" property="gid"/>
+        <result column="yqsdw" property="yqsdw"/>
+        <result column="scmj" property="scmj"/>
+        <result column="scjg" property="scjg"/>
+        <result column="scwh" property="scwh"/>
+        <result column="scsj" property="scsj"/>
+        <result column="mj" property="mj"/>
+        <result column="scfs" property="scfs"/>
+        <result column="scnd" property="scnd"/>
+        <result column="tdzl" property="tdzl"/>
+        <result column="ytdyt" property="ytdyt"/>
+        <result column="ytdsyqxz" property="ytdsyqxz"/>
+        <result column="wzfbck" property="wzfbck"/>
+        <result column="bz" property="bz"/>
+        <result column="bsm" property="bsm"/>
+        <result column="xzq" property="xzq"/>
+        <result column="dabh" property="dabh"/>
+        <result column="shape_leng" property="shapeLeng"/>
+        <result column="shape_area" property="shapeArea"/>
+        <result column="项目名" property="xmmc"/>
+        <result column="sccb" property="sccb"/>
+        <result column="面积_亩" property="mjMu"/>
+        <result column="geom" property="geom"/>
+    </resultMap>
+
+    <insert id="add" parameterType="com.siwei.apply.domain.GjShijiShouchu">
+        INSERT INTO vector.gj_shiji_shouchu (yqsdw, scmj, scjg, scwh, scsj, mj, scfs, scnd, tdzl, ytdyt, ytdsyqxz, wzfbck, bz, bsm, xzq, dabh, shape_leng, shape_area, "项目名", sccb, "面积_亩", geom)
+        VALUES (#{yqsdw}, #{scmj}, #{scjg}, #{scwh}, #{scsj}, #{mj}, #{scfs}, #{scnd}, #{tdzl}, #{ytdyt}, #{ytdsyqxz}, #{wzfbck}, #{bz}, #{bsm}, #{xzq}, #{dabh}, #{shapeLeng}, #{shapeArea}, #{xmmc}, #{sccb}, #{mjMu}, ST_GeomFromEWKT(#{geom}))
+    </insert>
+
+    <select id="get" resultMap="gjShijiShouchuMap">
+        SELECT gid, yqsdw, scmj, scjg, scwh, scsj, mj, scfs, scnd, tdzl, ytdyt, ytdsyqxz, wzfbck, bz, bsm, xzq, dabh, shape_leng, shape_area, "项目名", sccb, "面积_亩", ST_AsEWKT(geom) as geom
+        FROM vector.gj_shiji_shouchu
+        WHERE gid = #{gid}
+    </select>
+
+    <select id="getList" parameterType="com.siwei.apply.domain.vo.GjShijiShouchuFilterVo" resultMap="gjShijiShouchuMap">
+        SELECT gid, yqsdw, scmj, scjg, scwh, scsj, mj, scfs, scnd, tdzl, ytdyt, ytdsyqxz, wzfbck, bz, bsm, xzq, dabh, shape_leng, shape_area, "项目名", sccb, "面积_亩", ST_AsEWKT(geom) as geom
+        FROM vector.gj_shiji_shouchu
+        <where>
+            <if test="xmmc != null and xmmc != ''">
+                AND "项目名" LIKE CONCAT('%', #{xmmc}, '%')
+            </if>
+            <if test="xzq != null and xzq != ''">
+                AND xzq = #{xzq}
+            </if>
+            <if test="scfs != null and scfs != ''">
+                AND scfs = #{scfs}
+            </if>
+            <if test="startDate != null and startDate != ''">
+                AND scsj &gt;= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND scsj &lt;= #{endDate}
+            </if>
+        </where>
+        ORDER BY gid DESC
+        LIMIT #{pageSize} OFFSET #{offset}
+    </select>
+
+    <select id="getCount" parameterType="com.siwei.apply.domain.vo.GjShijiShouchuFilterVo" resultType="int">
+        SELECT COUNT(*)
+        FROM vector.gj_shiji_shouchu
+        <where>
+            <if test="xmmc != null and xmmc != ''">
+                AND "项目名" LIKE CONCAT('%', #{xmmc}, '%')
+            </if>
+            <if test="xzq != null and xzq != ''">
+                AND xzq = #{xzq}
+            </if>
+            <if test="scfs != null and scfs != ''">
+                AND scfs = #{scfs}
+            </if>
+            <if test="startDate != null and startDate != ''">
+                AND scsj &gt;= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND scsj &lt;= #{endDate}
+            </if>
+        </where>
+    </select>
+
+    <update id="update" parameterType="com.siwei.apply.domain.GjShijiShouchu">
+        UPDATE vector.gj_shiji_shouchu
+        <set>
+            <if test="yqsdw != null">yqsdw = #{yqsdw},</if>
+            <if test="scmj != null">scmj = #{scmj},</if>
+            <if test="scjg != null">scjg = #{scjg},</if>
+            <if test="scwh != null">scwh = #{scwh},</if>
+            <if test="scsj != null">scsj = #{scsj},</if>
+            <if test="mj != null">mj = #{mj},</if>
+            <if test="scfs != null">scfs = #{scfs},</if>
+            <if test="scnd != null">scnd = #{scnd},</if>
+            <if test="tdzl != null">tdzl = #{tdzl},</if>
+            <if test="ytdyt != null">ytdyt = #{ytdyt},</if>
+            <if test="ytdsyqxz != null">ytdsyqxz = #{ytdsyqxz},</if>
+            <if test="wzfbck != null">wzfbck = #{wzfbck},</if>
+            <if test="bz != null">bz = #{bz},</if>
+            <if test="bsm != null">bsm = #{bsm},</if>
+            <if test="xzq != null">xzq = #{xzq},</if>
+            <if test="dabh != null">dabh = #{dabh},</if>
+            <if test="shapeLeng != null">shape_leng = #{shapeLeng},</if>
+            <if test="shapeArea != null">shape_area = #{shapeArea},</if>
+            <if test="xmmc != null">"项目名" = #{xmmc},</if>
+            <if test="sccb != null">sccb = #{sccb},</if>
+            <if test="mjMu != null">"面积_亩" = #{mjMu},</if>
+            <if test="geom != null">geom = ST_GeomFromEWKT(#{geom}),</if>
+        </set>
+        WHERE gid = #{gid}
+    </update>
+
+    <delete id="batchDelete">
+        DELETE FROM vector.gj_shiji_shouchu
+        WHERE gid IN
+        <foreach collection="gids" item="gid" open="(" separator="," close=")">
+            #{gid}
+        </foreach>
+    </delete>
+
+    <select id="getByGeomIntersects" resultMap="gjShijiShouchuMap">
+        SELECT gid, yqsdw, scmj, scjg, scwh, scsj, mj, scfs, scnd, tdzl, ytdyt, ytdsyqxz, wzfbck, bz, bsm, xzq, dabh, shape_leng, shape_area, "项目名", sccb, "面积_亩", ST_AsEWKT(geom) as geom
+        FROM vector.gj_shiji_shouchu
+        WHERE public.ST_Intersects(geom, public.ST_GeomFromEWKT(#{ewkt}))
+    </select>
+
+</mapper>