@@ -1,6 +1,9 @@ | |||||
package com.ruoyi.web.controller.bigscreen; | package com.ruoyi.web.controller.bigscreen; | ||||
import cn.hutool.core.collection.CollectionUtil; | |||||
import com.ruoyi.common.constant.CacheConstants; | |||||
import com.ruoyi.common.core.controller.BaseController; | import com.ruoyi.common.core.controller.BaseController; | ||||
import com.ruoyi.common.core.domain.AjaxResult; | |||||
import com.ruoyi.common.core.domain.entity.SysDept; | import com.ruoyi.common.core.domain.entity.SysDept; | ||||
import com.ruoyi.common.core.domain.model.LoginUser; | import com.ruoyi.common.core.domain.model.LoginUser; | ||||
import com.ruoyi.common.core.page.TableDataInfo; | import com.ruoyi.common.core.page.TableDataInfo; | ||||
@@ -8,17 +11,22 @@ import com.ruoyi.common.core.redis.RedisCache; | |||||
import com.ruoyi.common.utils.ServletUtils; | import com.ruoyi.common.utils.ServletUtils; | ||||
import com.ruoyi.common.utils.StringUtils; | import com.ruoyi.common.utils.StringUtils; | ||||
import com.ruoyi.framework.web.service.TokenService; | import com.ruoyi.framework.web.service.TokenService; | ||||
import com.ruoyi.resource.domain.TBigDataScreen; | |||||
import com.ruoyi.resource.domain.TResourceLand; | import com.ruoyi.resource.domain.TResourceLand; | ||||
import com.ruoyi.resource.domain.TResourceLandMap; | import com.ruoyi.resource.domain.TResourceLandMap; | ||||
import com.ruoyi.resource.service.ITResourceLandService; | import com.ruoyi.resource.service.ITResourceLandService; | ||||
import com.ruoyi.system.service.ISysDeptService; | import com.ruoyi.system.service.ISysDeptService; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import java.math.BigDecimal; | |||||
import java.text.DecimalFormat; | |||||
import java.util.HashMap; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | |||||
import java.util.Objects; | |||||
import java.util.concurrent.TimeUnit; | |||||
/** | /** | ||||
* @description: | * @description: | ||||
@@ -67,4 +75,31 @@ public class ResourceBigController extends BaseController { | |||||
return getDataTable(list); | return getDataTable(list); | ||||
} | } | ||||
/** | |||||
* 首页统计 | |||||
*/ | |||||
@GetMapping("/homepageStatistics") | |||||
public AjaxResult homepageStatistics() { | |||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); | |||||
Object statisticVOMap = redisCache.getCacheObject(CacheConstants.BIG_DATA_RESOURCE_KEY+"homepageStatistics" + loginUser.getUser().getUserName()); | |||||
if (Objects.nonNull(statisticVOMap)) { | |||||
return AjaxResult.success(statisticVOMap); | |||||
} | |||||
List<TBigDataScreen> list = tResourceLandService.progressResourceInvestigationStatistics(loginUser.getUser().getDeptId());//资源调查进度统计 | |||||
TBigDataScreen tBigDataScreen = tResourceLandService.homepageDownStatistics(loginUser.getUser().getDeptId());//首页下面统计 | |||||
Map map = new HashMap(); | |||||
map.put("progressResourceInvestigation",list); | |||||
map.put("homepageStatistics",tBigDataScreen); | |||||
redisCache.setCacheObject(CacheConstants.BIG_DATA_RESOURCE_KEY+"homepageStatistics" + loginUser.getUser().getUserName(), map, expireTime, TimeUnit.MINUTES); | |||||
return AjaxResult.success(map); | |||||
} | |||||
/**元转万元且保留两位小数并四舍五入*/ | |||||
public static String getNumberWanTwo(BigDecimal bigDecimal) { | |||||
// 转换为万元(除以10000) | |||||
BigDecimal decimal = bigDecimal.divide(new BigDecimal("10000")); | |||||
DecimalFormat df = new DecimalFormat("#0.00"); | |||||
String str1 = df.format(decimal); | |||||
return str1; | |||||
} | |||||
} | } |
@@ -0,0 +1,55 @@ | |||||
package com.ruoyi.resource.domain; | |||||
import com.ruoyi.common.annotation.Excel; | |||||
import lombok.Data; | |||||
import java.math.BigDecimal; | |||||
/** | |||||
* 地块属性对象 t_resource_land | |||||
* | |||||
* @author rongxin | |||||
* @date 2025-09-05 | |||||
*/ | |||||
@Data | |||||
public class TBigDataScreen | |||||
{ | |||||
private static final long serialVersionUID = 1L; | |||||
/** 部门ID */ | |||||
private Long deptId; | |||||
/** 部门名称 */ | |||||
private String deptName; | |||||
/** 统计数量1 首页上 资源调查进度统计 - */ | |||||
private String dataNum1; | |||||
/** 统计数量2 */ | |||||
private String dataNum2; | |||||
/** 统计数量3 */ | |||||
private String dataNum3; | |||||
/** 统计数量4 */ | |||||
private String dataNum4; | |||||
/** 统计数量5 */ | |||||
private String dataNum5; | |||||
/** 统计数量6 */ | |||||
private String dataNum6; | |||||
/** 统计数量7 */ | |||||
private String dataNum7; | |||||
/** 统计数量8 */ | |||||
private String dataNum8; | |||||
/** 统计数量9 */ | |||||
private String dataNum9; | |||||
/** 统计数量10 */ | |||||
private String dataNum10; | |||||
} |
@@ -23,6 +23,10 @@ public class TResourceVo { | |||||
@Excel(name = "区域位置名称") | @Excel(name = "区域位置名称") | ||||
private String deptName; | private String deptName; | ||||
/** 部门级联代码 */ | |||||
@Excel(name = "部门级联代码") | |||||
private String importCode; | |||||
/** 标识码 */ | /** 标识码 */ | ||||
@Excel(name = "标识码 */") | @Excel(name = "标识码 */") | ||||
private Integer bsm; | private Integer bsm; | ||||
@@ -1,5 +1,6 @@ | |||||
package com.ruoyi.resource.mapper; | package com.ruoyi.resource.mapper; | ||||
import com.ruoyi.resource.domain.TBigDataScreen; | |||||
import com.ruoyi.resource.domain.TResourceLand; | import com.ruoyi.resource.domain.TResourceLand; | ||||
import com.ruoyi.resource.domain.TResourceLandMap; | import com.ruoyi.resource.domain.TResourceLandMap; | ||||
@@ -83,5 +84,15 @@ public interface TResourceLandMapper | |||||
*/ | */ | ||||
public int deleteTResourceLandByFids(Long[] fids); | public int deleteTResourceLandByFids(Long[] fids); | ||||
/** | |||||
* 资源调查进度统计 | |||||
*/ | |||||
public List<TBigDataScreen> progressResourceInvestigationStatistics(Long deptId); | |||||
/** | |||||
* 首页下面统计 | |||||
*/ | |||||
public TBigDataScreen homepageDownStatistics(Long deptId); | |||||
} | } |
@@ -1,5 +1,6 @@ | |||||
package com.ruoyi.resource.service; | package com.ruoyi.resource.service; | ||||
import com.ruoyi.resource.domain.TBigDataScreen; | |||||
import com.ruoyi.resource.domain.TResourceLand; | import com.ruoyi.resource.domain.TResourceLand; | ||||
import com.ruoyi.resource.domain.TResourceLandMap; | import com.ruoyi.resource.domain.TResourceLandMap; | ||||
@@ -93,4 +94,14 @@ public interface ITResourceLandService | |||||
*/ | */ | ||||
public int deleteTResourceLandByFid(Long fid); | public int deleteTResourceLandByFid(Long fid); | ||||
/** | |||||
* 资源调查进度统计 | |||||
*/ | |||||
public List<TBigDataScreen> progressResourceInvestigationStatistics(Long deptId); | |||||
/** | |||||
* 首页下面统计 | |||||
*/ | |||||
public TBigDataScreen homepageDownStatistics(Long deptId); | |||||
} | } |
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil; | |||||
import com.ruoyi.common.exception.ServiceException; | import com.ruoyi.common.exception.ServiceException; | ||||
import com.ruoyi.common.utils.DateUtils; | import com.ruoyi.common.utils.DateUtils; | ||||
import com.ruoyi.common.utils.StringUtils; | import com.ruoyi.common.utils.StringUtils; | ||||
import com.ruoyi.resource.domain.TBigDataScreen; | |||||
import com.ruoyi.resource.domain.TResourceLand; | import com.ruoyi.resource.domain.TResourceLand; | ||||
import com.ruoyi.resource.domain.TResourceLandMap; | import com.ruoyi.resource.domain.TResourceLandMap; | ||||
import com.ruoyi.resource.mapper.TResourceLandMapper; | import com.ruoyi.resource.mapper.TResourceLandMapper; | ||||
@@ -233,5 +234,23 @@ public class TResourceLandServiceImpl implements ITResourceLandService | |||||
return tResourceLandMapper.deleteTResourceLandByFid(fid); | return tResourceLandMapper.deleteTResourceLandByFid(fid); | ||||
} | } | ||||
/** | |||||
* 资源调查进度统计 | |||||
*/ | |||||
@Override | |||||
public List<TBigDataScreen> progressResourceInvestigationStatistics(Long deptId) | |||||
{ | |||||
return tResourceLandMapper.progressResourceInvestigationStatistics(deptId); | |||||
} | |||||
/** | |||||
* 首页下面统计 | |||||
*/ | |||||
@Override | |||||
public TBigDataScreen homepageDownStatistics(Long deptId) | |||||
{ | |||||
return tResourceLandMapper.homepageDownStatistics(deptId); | |||||
} | |||||
} | } |
@@ -324,4 +324,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||
#{fid} | #{fid} | ||||
</foreach> | </foreach> | ||||
</delete> | </delete> | ||||
<resultMap type="TBigDataScreen" id="TBigDataScreenResult"> | |||||
<result property="deptId" column="dept_id" /> | |||||
<result property="deptName" column="dept_name" /> | |||||
<result property="dataNum1" column="data_num1" /> | |||||
<result property="dataNum2" column="data_num2" /> | |||||
<result property="dataNum3" column="data_num3" /> | |||||
<result property="dataNum4" column="data_num4" /> | |||||
<result property="dataNum5" column="data_num5" /> | |||||
<result property="dataNum6" column="data_num6" /> | |||||
<result property="dataNum7" column="data_num7" /> | |||||
<result property="dataNum8" column="data_num8" /> | |||||
<result property="dataNum9" column="data_num9" /> | |||||
<result property="dataNum10" column="data_num10" /> | |||||
</resultMap> | |||||
<select id="progressResourceInvestigationStatistics" parameterType="Long" resultMap="TBigDataScreenResult"> | |||||
SELECT d.dept_id AS dept_id, d.dept_name AS dept_name, | |||||
SUM(CASE WHEN l.survey_status = '1' THEN 1 ELSE 0 END) AS data_num1, | |||||
SUM(CASE WHEN l.survey_status = '2' THEN 1 ELSE 0 END) AS data_num2 | |||||
FROM sys_dept d | |||||
LEFT JOIN t_resource_land l ON l.import_code LIKE concat(d.import_code, '%') WHERE d.parent_id = #{deptId} | |||||
GROUP BY d.dept_id, d.dept_name ORDER BY d.dept_id | |||||
</select> | |||||
<select id="homepageDownStatistics" parameterType="Long" resultMap="TBigDataScreenResult"> | |||||
SELECT | |||||
d.dept_id AS dept_id, | |||||
d.dept_name AS dept_name, | |||||
COUNT(DISTINCT l.DKBM) AS data_num1,#地块总数 | |||||
SUM( CASE WHEN l.survey_status = '1' THEN 1 ELSE 0 END ) AS data_num2,#待调查总数 | |||||
SUM( CASE WHEN l.survey_status = '2' THEN 1 ELSE 0 END ) AS data_num3,#已调查总数 | |||||
SUM( l.SCMJM) AS data_num4,#地块总面积 | |||||
SUM( CASE WHEN l.dklb = '22' THEN l.SCMJM ELSE 0 END ) AS data_num5,#机动地总面积 | |||||
SUM( o.CBJE ) AS data_num6,#承包总金额 | |||||
SUM( o.DXJE ) AS data_num7,#兑现总金额 | |||||
SUM( o.SQJE ) AS data_num8,#尚欠总金额 | |||||
SUM( o.JYMJ ) AS data_num9,#经营总面积 | |||||
SUM( o.NSY ) AS data_num10#年总收益 | |||||
FROM sys_dept d | |||||
LEFT JOIN t_resource_land l ON l.import_code LIKE concat( d.import_code, '%' ) | |||||
LEFT JOIN t_resource_operation o ON l.DKBM = o.DKBM WHERE d.dept_id = #{deptId} | |||||
</select> | |||||
</mapper> | </mapper> |
@@ -38,8 +38,6 @@ public class SysGsiServiceImpl implements ISysGisService { | |||||
//坐标转换 | //坐标转换 | ||||
String houseApplyProposedSituations = SpaceUtils.space(gis.getTheGeom()); | String houseApplyProposedSituations = SpaceUtils.space(gis.getTheGeom()); | ||||
gis.setTheGeom(houseApplyProposedSituations); | gis.setTheGeom(houseApplyProposedSituations); | ||||
} else { | |||||
gis.setTheGeom(null); | |||||
} | } | ||||
return gisMapper.updateGeomByPolygon(gis); | return gisMapper.updateGeomByPolygon(gis); | ||||
} | } | ||||
@@ -50,8 +48,6 @@ public class SysGsiServiceImpl implements ISysGisService { | |||||
//坐标转换 | //坐标转换 | ||||
String houseApplyProposedSituations = SpaceUtils.space(gis.getTheGeom()); | String houseApplyProposedSituations = SpaceUtils.space(gis.getTheGeom()); | ||||
gis.setTheGeom(houseApplyProposedSituations); | gis.setTheGeom(houseApplyProposedSituations); | ||||
} else { | |||||
gis.setTheGeom(null); | |||||
} | } | ||||
return gisMapper.updateGeomByPolygonPri(gis); | return gisMapper.updateGeomByPolygonPri(gis); | ||||
} | } | ||||