Jelajahi Sumber

工程現場 接口修改

zhanghao 2 hari lalu
induk
melakukan
57c2d01259

+ 12 - 34
src/main/java/com/project/zcustom/domain/addional/LargeHousingLand.java

@@ -31,57 +31,35 @@ public class LargeHousingLand extends CustomBaseEntity {
     private Long id;
 
     /**
-     * 房产名称
+     * 房产数量
      */
-
-
-    private String housing;
+    private Long houseNum;
 
     /**
      * 房产面积
      */
-
-
-    private BigDecimal acreage;
-
-    /**
-     * 房产类型
-     */
-
-
-    private Long type;
-
-    @TableField(exist = false)
-    private String typeName;
+    private BigDecimal houseAcreage;
 
     /**
-     * 施工时间
+     * 土地数量
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-
-
-    private Date constructionTime;
+    private Long landNum;
 
     /**
-     * 是否拥有所有权(0否;1是)
+     * 土地面积
      */
-
-
-    private Integer ownershipFlag;
+    private BigDecimal landAcreage;
 
     /**
-     * 是否为投资计划(0否;1是)
+     * 房产类型
      */
-
-
-    private Integer investmentPlanFlag;
-
-    @TableField(exist = false)
-    private Long num;
-
+    private Long type;
 
     /**
      * 所属单位编码
      */
     private String appOrg;
+
+    @TableField(exist = false)
+    private String typeName;
 }

+ 1 - 1
src/main/java/com/project/zcustom/mapper/logistics/PlatHousingLandMapper.java

@@ -9,7 +9,7 @@ import java.util.Map;
 public interface PlatHousingLandMapper extends BaseMapper<LargeHousingLand> {
     List<LargeHousingLand> getStockOfEstateResources(String appOrg);
 
-    Map<String, Object> getStockOfLandResources(String appOrg);
+    List<LargeHousingLand>  getStockOfLandResources(String appOrg);
 
     Map<String, Object> getInvestFinishState(String appOrg);
 

+ 34 - 23
src/main/java/com/project/zcustom/service/logistics/impl/LargeHousingLandServiceImpl.java

@@ -26,12 +26,12 @@ public class LargeHousingLandServiceImpl extends ServiceImpl<PlatHousingLandMapp
 
 
     public Map<String, Object> getStockOfEstateResources(String appOrg){
-        String[] strArr = {"办公用房", "周转用房", "生产管理", "教育培训用房", "交流干部住房", "单身公寓/单身宿舍"};
+        String[] strArr = {"供电所用房", "物资仓储用房", "办公用房", "周转用房"};
         List<LargeHousingLand> arr = new ArrayList<>();
-        for (int i = 0; i < 6; i++){
+        for (int i = 0; i < 4; i++){
             LargeHousingLand land = new LargeHousingLand();
-            land.setNum(0L);
-            land.setAcreage(BigDecimal.valueOf(0));
+            land.setHouseNum(0L);
+            land.setHouseAcreage(BigDecimal.valueOf(0));
             land.setType((long) i);
             land.setTypeName(strArr[i]);
             arr.add(land);
@@ -41,10 +41,10 @@ public class LargeHousingLandServiceImpl extends ServiceImpl<PlatHousingLandMapp
         BigDecimal housingAcreage = new BigDecimal(0);
         Long housingNum = 0L;
         for (LargeHousingLand it : list){
-            housingAcreage = housingAcreage.add(it.getAcreage());
-            housingNum += it.getNum();
-            arr.get(it.getType().intValue()).setAcreage(it.getAcreage());
-            arr.get(it.getType().intValue()).setNum(it.getNum());
+            housingAcreage = housingAcreage.add(it.getHouseAcreage());
+            housingNum += it.getHouseNum();
+            arr.get(it.getType().intValue()).setHouseAcreage(it.getHouseAcreage());
+            arr.get(it.getType().intValue()).setHouseNum(it.getHouseNum());
         }
         map.put("pieChart", arr);
         map.put("housingNum", housingNum);
@@ -53,7 +53,30 @@ public class LargeHousingLandServiceImpl extends ServiceImpl<PlatHousingLandMapp
     }
 
     public Map<String, Object> getStockOfLandResources(String appOrg){
-        return platHousingLandMapper.getStockOfLandResources(appOrg);
+        String[] strArr = {"供电所用房土地", "物资仓储用房土地", "办公用房土地", "周转用房土地"};
+        List<LargeHousingLand> arr = new ArrayList<>();
+        for (int i = 0; i < 4; i++){
+            LargeHousingLand land = new LargeHousingLand();
+            land.setLandNum(0L);
+            land.setLandAcreage(BigDecimal.valueOf(0));
+            land.setType((long) i);
+            land.setTypeName(strArr[i]);
+            arr.add(land);
+        }
+        List<LargeHousingLand> list = platHousingLandMapper.getStockOfLandResources(appOrg);
+        Map<String, Object> map = new HashMap<>();
+        BigDecimal landAcreage = new BigDecimal(0);
+        Long landNum = 0L;
+        for (LargeHousingLand it : list){
+            landAcreage = landAcreage.add(it.getLandAcreage());
+            landNum += it.getLandNum();
+            arr.get(it.getType().intValue()).setLandAcreage(it.getLandAcreage());
+            arr.get(it.getType().intValue()).setLandNum(it.getLandNum());
+        }
+        map.put("chart", arr);
+        map.put("landNum", landNum);
+        map.put("landAcreage", landAcreage);
+        return map;
     }
 
     public Map<String, Object> getInvestFinishState(String appOrg){
@@ -81,24 +104,12 @@ public class LargeHousingLandServiceImpl extends ServiceImpl<PlatHousingLandMapp
      */
     private LambdaQueryWrapper<LargeHousingLand> getLambdaQueryWrapper(LargeHousingLand largePlatHousingLand) {
         LambdaQueryWrapper<LargeHousingLand> lqw = new LambdaQueryWrapper<LargeHousingLand>();
-        if (StringUtils.isNotBlank(largePlatHousingLand.getHousing())){
-            lqw.eq(LargeHousingLand::getHousing ,largePlatHousingLand.getHousing());
-        }
-        if (StringUtils.isNotNull(largePlatHousingLand.getAcreage())){
-            lqw.eq(LargeHousingLand::getAcreage ,largePlatHousingLand.getAcreage());
+        if (StringUtils.isNotNull(largePlatHousingLand.getAppOrg())){
+            lqw.eq(LargeHousingLand::getAppOrg ,largePlatHousingLand.getAppOrg());
         }
         if (StringUtils.isNotNull(largePlatHousingLand.getType())){
             lqw.eq(LargeHousingLand::getType ,largePlatHousingLand.getType());
         }
-        if (StringUtils.isNotNull(largePlatHousingLand.getConstructionTime())){
-            lqw.eq(LargeHousingLand::getConstructionTime ,largePlatHousingLand.getConstructionTime());
-        }
-        if (StringUtils.isNotNull(largePlatHousingLand.getOwnershipFlag())){
-            lqw.eq(LargeHousingLand::getOwnershipFlag ,largePlatHousingLand.getOwnershipFlag());
-        }
-        if (StringUtils.isNotNull(largePlatHousingLand.getInvestmentPlanFlag())){
-            lqw.eq(LargeHousingLand::getInvestmentPlanFlag ,largePlatHousingLand.getInvestmentPlanFlag());
-        }
         return lqw;
     }
 }

+ 28 - 24
src/main/resources/mapper/zcustom/logistics/PlatHousingLandMapper.xml

@@ -5,16 +5,18 @@
 <mapper namespace="com.project.zcustom.mapper.logistics.PlatHousingLandMapper">
     <resultMap type="com.project.zcustom.domain.addional.LargeHousingLand" id="LargeHousingLandResult">
         <result property="id"    column="id"    />
-        <result property="housing"    column="housing"    />
-        <result property="investmentPlanFlag"    column="investment_plan_flag"    />
-        <result property="ownershipFlag"    column="ownership_flag"    />
-        <result property="constructionTime"    column="construction_time"    />
+        <result property="houseNum"    column="house_num"    />
+        <result property="houseAcreage"    column="house_acreage"    />
+        <result property="landNum"    column="land_num"    />
+        <result property="landAcreage"    column="land_acreage"    />
+        <result property="type"    column="type"    />
+        <result property="appOrg"    column="app_org"    />
     </resultMap>
 
     <select id="getStockOfEstateResources" parameterType="String" resultMap="LargeHousingLandResult">
         SELECT
-        count( 1 ) AS num,
-        sum( acreage ) AS acreage,
+        sum( house_num ) AS house_num,
+        sum( house_acreage ) AS house_acreage,
         type
         FROM
         large_plat_housing_land
@@ -24,15 +26,17 @@
         type
     </select>
 
-    <select id="getStockOfLandResources" parameterType="String" resultType="map">
+    <select id="getStockOfLandResources" parameterType="String" resultMap="LargeHousingLandResult">
         SELECT
-        count( 1 ) AS num,
-        COUNT( CASE WHEN YEAR ( construction_time ) >= YEAR ( CURDATE()) THEN 1 END ) AS new,
-        COUNT( CASE WHEN ownership_flag = 1 THEN 1 END ) AS own
+        sum( land_num ) AS land_num,
+        sum( land_acreage ) AS land_acreage,
+        type
         FROM
         large_plat_housing_land
         WHERE del_flag = '0'
         <if test="appOrg != '0000'"> AND app_org = #{appOrg} </if>
+        GROUP BY
+        type
     </select>
 
     <select id="getInvestFinishState" parameterType="String" resultType="map">
@@ -46,24 +50,24 @@
     </select>
 
     <insert id="upload" parameterType="com.project.zcustom.domain.addional.LargeHousingLand">
-        insert into large_plat_housing_land (housing,
-                                          acreage,
-                                          type,
-                                          ownership_flag,
-                                          investment_plan_flag,
-                                          construction_time,
-                                          del_flag,
-                                          create_time)
+        insert into large_plat_housing_land (house_num,
+        house_acreage,
+        land_num,
+        land_acreage,
+        type,
+        app_org,
+        del_flag,
+        create_time)
         values
         <foreach collection="list" item="item" separator="," close=";">
             <trim prefix="(" suffix=")" suffixOverrides=",">
-                #{item.housing},
-                #{item.acreage},
+                #{item.houseNum},
+                #{item.houseAcreage},
+                #{item.landNum},
+                #{item.landAcreage},
                 #{item.type},
-                #{item.ownershipFlag},
-                #{item.investmentPlanFlag},
-                #{item.constructionTime},
-            '0', sysdate()
+                #{item.appOrg},
+                '0', sysdate()
             </trim>
         </foreach>
     </insert>