From e544c9f30239e791903a6c0a1a01784d249957d0 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期三, 19 三月 2025 18:19:07 +0800 Subject: [PATCH] 大屏接口 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ScreenController.java | 20 +++ ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenTopStaticsDataVO.java | 41 ++++++++ ruoyi-system/src/main/java/com/ruoyi/system/service/ITStreetService.java | 16 +++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TStreetController.java | 50 ++++++++++ ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java | 18 +++ ruoyi-system/src/main/resources/mapper/system/TStreetMapper.xml | 5 + ruoyi-system/src/main/java/com/ruoyi/system/model/TStreet.java | 38 +++++++ ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TStreetServiceImpl.java | 20 ++++ ruoyi-system/src/main/java/com/ruoyi/system/mapper/TStreetMapper.java | 16 +++ ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java | 22 +++- ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenRentRankVO.java | 21 ++++ 11 files changed, 261 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ScreenController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ScreenController.java index 354a246..4fe08d7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ScreenController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/ScreenController.java @@ -1,10 +1,18 @@ package com.ruoyi.web.controller.api; +import com.ruoyi.common.core.domain.R; import com.ruoyi.system.service.impl.ScreenService; +import com.ruoyi.system.vo.ScreenRentRankVO; +import com.ruoyi.system.vo.ScreenTopStaticsDataVO; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import java.util.List; /** * @author mitao @@ -13,7 +21,17 @@ @Api(tags = {"大屏相关接口"}) @RestController @RequestMapping("/screen") -@RequiredArgsConstructor +@RequiredArgsConstructor(onConstructor_ = {@Lazy}) public class ScreenController { private final ScreenService screenService; + @GetMapping("/statics-data") + @ApiOperation(value = "获取顶部统计数据") + public R<ScreenTopStaticsDataVO> getTopStaticsData() { + return R.ok(screenService.getTopStaticsData()); + } + @ApiOperation("区域租金排名") + @GetMapping("/rent-rank") + public R<List<ScreenRentRankVO>> rentRank() { + return R.ok(screenService.rentRank()); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TStreetController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TStreetController.java new file mode 100644 index 0000000..3f34a19 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TStreetController.java @@ -0,0 +1,50 @@ +package com.ruoyi.web.controller.api; + + +import com.google.common.collect.Lists; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.system.model.TStreet; +import com.ruoyi.system.service.ITStreetService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +/** + * <p> + * 街道 前端控制器 + * </p> + * + * @author mitao + * @since 2025-03-19 + */ +@Api(tags = {"街道相关接口"}) +@RestController +@RequestMapping("/t-street") +@RequiredArgsConstructor(onConstructor_ = {@Lazy}) +public class TStreetController { + private final ITStreetService tStreetService; + + @GetMapping("/list") + @ApiOperation(value = "获取街道列表") + public R<List<TStreet>> list() { + return R.ok(tStreetService.list()); + } + @GetMapping("/init") + @ApiOperation(value = "初始化街道列表") + public R<?> init(){ + ArrayList<String> strings = Lists.newArrayList("八廓街道", "吉日街道", "布达拉宫广场街道", "公德林街道", "扎细街道", "纳金街道", "娘热街道", "金珠西路街道", "堆龙德庆区东嘎街道", "两岛街道", "柳梧新区柳梧乡", "色拉街道", "蔡公堂街道", "娘热路街道", "夺底街道", "纳如街道"); + strings.forEach(streetName->{ + TStreet tStreet = new TStreet(); + tStreet.setStreetName(streetName); + tStreetService.save(tStreet); + }); + return R.ok(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TStreetMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TStreetMapper.java new file mode 100644 index 0000000..5b6275f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TStreetMapper.java @@ -0,0 +1,16 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.model.TStreet; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * <p> + * 街道 Mapper 接口 + * </p> + * + * @author mitao + * @since 2025-03-19 + */ +public interface TStreetMapper extends BaseMapper<TStreet> { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java b/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java index 9a03ab2..eeffb53 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java @@ -1,18 +1,18 @@ package com.ruoyi.system.model; import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; - +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.domain.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.time.LocalDateTime; /** * <p> @@ -94,4 +94,16 @@ @ApiModelProperty(value = "住户类型 1月租 2季租 3年租") @TableField(exist = false) private String tenantType; + + @ApiModelProperty(value = "所属街道id") + @TableField("street_id") + private String streetId; + + @ApiModelProperty(value = "经度") + @TableField("longitude") + private BigDecimal longitude; + + @ApiModelProperty(value = "纬度") + @TableField("latitude") + private BigDecimal latitude; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/model/TStreet.java b/ruoyi-system/src/main/java/com/ruoyi/system/model/TStreet.java new file mode 100644 index 0000000..7a86d29 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/model/TStreet.java @@ -0,0 +1,38 @@ +package com.ruoyi.system.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.core.domain.BaseModel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * <p> + * 街道 + * </p> + * + * @author mitao + * @since 2025-03-19 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("t_street") +@ApiModel(value="TStreet对象", description="街道") +public class TStreet extends BaseModel implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "物品名称") + private String streetName; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITStreetService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITStreetService.java new file mode 100644 index 0000000..f677154 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITStreetService.java @@ -0,0 +1,16 @@ +package com.ruoyi.system.service; + +import com.ruoyi.system.model.TStreet; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 街道 服务类 + * </p> + * + * @author mitao + * @since 2025-03-19 + */ +public interface ITStreetService extends IService<TStreet> { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java index c1b1e70..cf3554a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java @@ -1,8 +1,12 @@ package com.ruoyi.system.service.impl; +import com.ruoyi.system.vo.ScreenRentRankVO; +import com.ruoyi.system.vo.ScreenTopStaticsDataVO; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; + +import java.util.List; /** * @author mitao @@ -11,5 +15,19 @@ @Service @RequiredArgsConstructor(onConstructor_ = {@Lazy}) public class ScreenService { + /** + * 获取顶部统计数据 + * @return + */ + public ScreenTopStaticsDataVO getTopStaticsData() { + return null; + } + /** + * 区域租金排名 + * @return + */ + public List<ScreenRentRankVO> rentRank() { + return null; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TStreetServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TStreetServiceImpl.java new file mode 100644 index 0000000..b303626 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TStreetServiceImpl.java @@ -0,0 +1,20 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.system.model.TStreet; +import com.ruoyi.system.mapper.TStreetMapper; +import com.ruoyi.system.service.ITStreetService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 街道 服务实现类 + * </p> + * + * @author mitao + * @since 2025-03-19 + */ +@Service +public class TStreetServiceImpl extends ServiceImpl<TStreetMapper, TStreet> implements ITStreetService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenRentRankVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenRentRankVO.java new file mode 100644 index 0000000..4b1f3f1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenRentRankVO.java @@ -0,0 +1,21 @@ +package com.ruoyi.system.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author mitao + * @date 2025/3/19 + */ +@Data +@ApiModel("区域租金排名") +public class ScreenRentRankVO { + @ApiModelProperty("街道名称") + private String streetName; + + @ApiModelProperty("租金") + private BigDecimal rentAmount; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenTopStaticsDataVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenTopStaticsDataVO.java new file mode 100644 index 0000000..87cabfb --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenTopStaticsDataVO.java @@ -0,0 +1,41 @@ +package com.ruoyi.system.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author mitao + * @date 2025/3/19 + */ +@Data +@ApiModel("顶部统计数据") +public class ScreenTopStaticsDataVO { + + @ApiModelProperty("房屋总面积") + private Double houseTotalArea; + + @ApiModelProperty("已出租面积") + private Double houseRentedArea; + + @ApiModelProperty("总计应收租金") + private BigDecimal totalReceivableRent; + + @ApiModelProperty("总计已收租金") + private BigDecimal totalReceivedRent; + + @ApiModelProperty("本月新增租户数") + private Integer newTenantCount; + + @ApiModelProperty("总计租户数") + private Integer totalTenantCount; + + @ApiModelProperty("本季度已交租金") + private BigDecimal totalRentPaid; + + @ApiModelProperty("本季度应交租金") + private BigDecimal totalRentShould; +} + diff --git a/ruoyi-system/src/main/resources/mapper/system/TStreetMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TStreetMapper.xml new file mode 100644 index 0000000..296a7b9 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/TStreetMapper.xml @@ -0,0 +1,5 @@ +<?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.ruoyi.system.mapper.TStreetMapper"> + +</mapper> -- Gitblit v1.7.1