Kaynağa Gözat

关于增加batchType前端判断

chenendian 20 saat önce
ebeveyn
işleme
1dd83327df

+ 13 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/ReportBatchController.java

@@ -2,6 +2,7 @@ package com.siwei.apply.controller.cadastre;
 
 import com.siwei.apply.domain.YdbpData;
 import com.siwei.apply.domain.res.BatchRateRes;
+import com.siwei.apply.domain.vo.LandSupplyReportVO;
 import com.siwei.apply.service.cadastre.ISupplyService;
 import com.siwei.apply.service.cadastre.impl.BatchServiceImpl;
 import com.siwei.common.core.domain.R;
@@ -131,11 +132,20 @@ public class ReportBatchController extends BaseController {
 //            return R.fail(e.getMessage());
 //        }
 //    }
-//
-
-
 
 
+    /**
+     * 台账列表
+     */
+    @GetMapping("/report/bill/{year}")
+    public R<?> billProjectList(@PathVariable String year) {
+        try {
+            List<YdbpData> resList =  batchServiceImpl.billProjectList(year);
+            return R.ok(resList);
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+    }
 
 
 

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/YdbpData.java

@@ -26,6 +26,7 @@ public class YdbpData extends BaseId {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updatedAt;
     private String projectPropertyId;
+    private String batchType;
     private String geom;
 
 }

+ 36 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/BatchServiceImpl.java

@@ -4,6 +4,7 @@ import com.siwei.apply.domain.YdbpData;
 import com.siwei.apply.domain.res.*;
 import com.siwei.apply.domain.vo.LandSupplyProjectVO;
 import com.siwei.apply.mapper.*;
+import com.siwei.common.core.exception.ServiceException;
 import com.siwei.common.core.utils.StringUtils;
 import com.siwei.spatial.api.RemoteSpatialFilesDbService;
 import lombok.extern.slf4j.Slf4j;
@@ -71,13 +72,13 @@ public class BatchServiceImpl{
         }
          singleBatchList.forEach(item -> {
             item.put("projectPropertyId",item.get("project_id") == null ? "" : String.valueOf(item.get("project_id")));
+            item.put("batchType",item.get("batch_type") == null ? "" : String.valueOf(item.get("batch_type")));
             Double mj_mu = (Double) item.get("mj_mu");
             item.put("mj_mu",String.format("%.2f", mj_mu == null ? 0d : mj_mu));
         });
         return singleBatchList;
     }
 
-
     private List<YdbpData> buildReportProjectList(String year, String keyWord) {
         List<YdbpData> reportBatchList =  ydbpDataMapper.getStatisticsList(year,keyWord,true);
         if (CollectionUtils.isEmpty(reportBatchList)) {
@@ -101,6 +102,39 @@ public class BatchServiceImpl{
         return  ydbpDataMapper.getById(propertyId);
     }
 
+
+
+    public List<YdbpData> billProjectList(String year) {
+        if(StringUtils.isBlank(year)){
+            throw new  ServiceException("年份不能为空");
+        }
+        List<YdbpData> resList = new ArrayList<>();
+        List<YdbpData> reportBatchList =  ydbpDataMapper.getStatisticsList(year,"",false);
+        if(CollectionUtils.isNotEmpty(reportBatchList)){
+            resList.addAll(reportBatchList);
+        }
+        List<Map<String,Object>> singleBatchList =  ydbpMapper.getStatisticsList(year,"",false);
+        if(CollectionUtils.isNotEmpty(singleBatchList)){
+            singleBatchList.stream().map(s->{
+                YdbpData ydbpData = new YdbpData();
+                ydbpData.setProjectPropertyId(s.get("project_id") == null ? "" : String.valueOf(s.get("project_id")));
+                ydbpData.setName(s.get("project_name")+"");
+                ydbpData.setBatchType(s.get("batch_type")+"");
+                ydbpData.setYdArea(s.get("yd_area") == null ? 0f : Float.parseFloat(String.valueOf(s.get("yd_area"))));
+                ydbpData.setZsArea(s.get("mj_mu") == null ? 0f : Float.parseFloat(String.valueOf(s.get("mj_mu"))));
+                ydbpData.setBpDate(s.get("bp_date")+"");
+                ydbpData.setPfDate(s.get("pf_date")+"");
+                ydbpData.setPfwh(s.get("pfwh")+"");
+                return ydbpData;
+            }).forEach(resList::add);
+        }
+        return resList;
+    }
+
+
+
+
+
     /**
      * 年度统计
      * @param year
@@ -122,7 +156,7 @@ public class BatchServiceImpl{
             groupedSingleBatch = singleBatchList.stream()
                     .collect(Collectors.groupingBy(s->{
                         Object nfStr = s.get("nf");
-                        if(nfStr==null || String.valueOf(nfStr).isEmpty()){
+                        if(nfStr==null || String.valueOf(nfStr).isEmpty()||"1000".equals(String.valueOf(nfStr))){
                             return "其它";
                         }
                         return String.valueOf(nfStr);

+ 26 - 18
siwei-modules/siwei-apply/src/main/resources/mapper/YdbpDataMapper.xml

@@ -18,6 +18,8 @@
         <result property="creatorId" column="creator_id"/>
         <result property="createdAt" column="created_at"/>
         <result property="updatedAt" column="updated_at"/>
+        <result property="batchType" column="batch_type"/>
+        <result property="projectPropertyId" column="project_property_id"/>
     </resultMap>
     <insert id="add" parameterType="com.siwei.apply.domain.YdbpData">
         INSERT INTO t_ydbp_data (
@@ -112,18 +114,30 @@
 
     <select id="getStatisticsList" resultMap="YdbpDataResultMap">
         SELECT
-            id, name, yd_area, yd_unit,
-        COALESCE (
-            CASE
-            WHEN zs_unit = '平方米' THEN
-            COALESCE ( zs_area, 0 ) / 666.6666667
-            WHEN zs_unit = '公顷' THEN
-            COALESCE ( zs_area, 0 ) * 15
-            WHEN zs_unit = '亩' THEN
-            COALESCE ( zs_area, 0 ) * 1
-            END,
-            0
-        ) AS zs_area ,
+            id, name,  yd_unit,
+            '2' AS batch_type,
+                COALESCE (
+                    CASE
+                    WHEN yd_unit = '平方米' THEN
+                    COALESCE ( yd_area, 0 ) / 666.6666667
+                    WHEN yd_unit = '公顷' THEN
+                    COALESCE ( yd_area, 0 ) * 15
+                    WHEN yd_unit = '亩' THEN
+                    COALESCE ( yd_area, 0 ) * 1
+                    END,
+                    0
+                ) AS yd_area ,
+                COALESCE (
+                        CASE
+                        WHEN zs_unit = '平方米' THEN
+                        COALESCE ( zs_area, 0 ) / 666.6666667
+                        WHEN zs_unit = '公顷' THEN
+                        COALESCE ( zs_area, 0 ) * 15
+                        WHEN zs_unit = '亩' THEN
+                        COALESCE ( zs_area, 0 ) * 1
+                        END,
+                        0
+                ) AS zs_area,
 
         <if test="hasGeom != null and hasGeom">
             (SELECT array_to_string(array_agg(ST_AsEWKT(gd.geom)), '|')
@@ -147,10 +161,4 @@
         </if>
     </select>
 
-
-
-
-
-
-
 </mapper>

+ 16 - 2
siwei-modules/siwei-apply/src/main/resources/mapper/YdbpMapper.xml

@@ -51,8 +51,22 @@
     <select id="getStatisticsList" resultType="map">
         SELECT
             pro.ID AS project_id,
-            bp.ID AS node_id,
-            bp.zs_area,
+            pro.name AS project_name,
+            '1' AS batch_type,
+            COALESCE (
+                CASE
+                WHEN bp.yd_unit = '平方米' THEN
+                COALESCE ( bp.yd_area, 0 ) / 666.6666667
+                WHEN bp.yd_unit = '公顷' THEN
+                COALESCE ( bp.yd_area, 0 ) * 15
+                WHEN bp.yd_unit = '亩' THEN
+                COALESCE ( bp.yd_area, 0 ) * 1
+                END,
+                0
+            ) AS yd_area, -- 用地面积(亩)
+            bp.bp_date,
+            bp.pfwh,
+            bp.pf_date,
             left(bp.pf_date,4) AS nf,
             bp.zs_unit,
             <if test="hasGeom != null and hasGeom">