Commit 18a10678 by wqc

app数据修改

parent 9060fe45
......@@ -51,7 +51,7 @@ public class ApiController {
return ApiUtils.getSuccessResp(form);
}
form.setType(2);
form.setType(1);
String method = form.getMethod();
if (StrUtil.isBlank(method)) {
method = request.getParameter("method");
......
......@@ -17,6 +17,9 @@ public interface PortalFeign {
@PostMapping("/stats/getMarriageStats")
ResultVo getMarriageStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getYearMarriedCouple")
ResultVo getYearMarriedCouple(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaUnderMarriageStatsList")
ResultVo getAreaUnderMarriageStatsList(@RequestBody Map<String, Object> paramsMap);
......
......@@ -32,6 +32,9 @@ public interface IApiLogic extends IApiCommon {
@ApiMethod(name = "获取婚姻统计", service = "PORTAL-SERVER")
ApiResp getMarriageStats(ApiForm form);
@ApiMethod(name = "获取1年结婚离婚对数", service = "PORTAL-SERVER")
ApiResp getYearMarriedCouple(ApiForm form);
@ApiMethod(name = "获取区域下的婚姻统计列表", service = "PORTAL-SERVER")
ApiResp getAreaUnderMarriageStatsList(ApiForm form);
......
......@@ -71,6 +71,11 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
}
@Override
public ApiResp getYearMarriedCouple(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getYearMarriedCouple(form.getParamsMap()));
}
@Override
public ApiResp getAreaUnderMarriageStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderMarriageStatsList(form.getParamsMap()));
}
......
......@@ -38,4 +38,10 @@ public class HyStatsController {
return ResultVo.success(hyStatsService.getCacheFivesYearMarriageLine(vo));
}
@ApiOperation("获取1年结婚离婚对数")
@PostMapping(value = "/getYearMarriedCouple")
public ResultVo getYearMarriedCouple(@RequestBody StatsReqVo vo) {
return ResultVo.success(hyStatsService.getCacheYearMarriedCouple(vo));
}
}
......@@ -69,4 +69,11 @@ public interface HyStatsDao {
*/
List<Map<String, Object>> search(SearchReqVo vo);
/**
* 获取结婚离婚对数
*
* @param vo
* @return
*/
List<StatsVo> getYearMarriedCouple(StatsReqVo vo);
}
......@@ -144,4 +144,8 @@ public abstract class PortalCacheKeys {
public static String getEnjoySumStatsKey(StatsReqVo vo) {
return PREFIX + "getEnjoySumStats." + vo.getAreaCode();
}
public static String getYearMarriedCoupleKey() {
return PREFIX+"getYearMarriedCouple";
}
}
......@@ -62,7 +62,7 @@ public class HyStatsService {
VMarriageStats build = VMarriageStats.builder()
.areaCode(area.getCode())
.areaName(area.getName())
.year(vo.getYear())
.year(2022)
.createTime(DateUtil.parseDate(DateUtil.today()))
.build();
......@@ -98,7 +98,8 @@ public class HyStatsService {
redisUtils.setObj(PortalCacheKeys.getMarriageStatsKey(vo), build);
// 放进数据库 有时间条件的不存库
VMarriageStats marriageStats = vMarriageStatsDao.selectOne(Wrappers.lambdaQuery(VMarriageStats.builder().year(vo.getYear() == null ? 0 : vo.getYear()).areaCode(area.getCode()).createTime(DateUtil.parseDate(DateUtil.today())).build()));
// VMarriageStats marriageStats = vMarriageStatsDao.selectOne(Wrappers.lambdaQuery(VMarriageStats.builder().year(vo.getYear() == null ? 0 : vo.getYear()).areaCode(area.getCode()).createTime(DateUtil.parseDate(DateUtil.today())).build()));
VMarriageStats marriageStats = vMarriageStatsDao.selectOne(Wrappers.lambdaQuery(VMarriageStats.builder().year(2022).areaCode(area.getCode()).createTime(DateUtil.parseDate(DateUtil.today())).build()));
if (marriageStats == null) {
vMarriageStatsDao.insert(build);
} else {
......@@ -390,4 +391,44 @@ public class HyStatsService {
return PagingUtils.paging(vo, hyStatsDao::search);
}
/**
* 获取缓存年统计结婚对数
*
* @param vo
* @return
*/
public Object getCacheYearMarriedCouple(StatsReqVo vo) {
Object obj = redisUtils.getObj(PortalCacheKeys.getYearMarriedCoupleKey());
if (obj != null) {
return obj;
}
return getYearMarriedCouple(vo);
}
/**
* 年统计结婚离婚对数
*
* @param vo
* @return
*/
private Object getYearMarriedCouple(StatsReqVo vo) {
Integer iaCount=null;
Integer ibCount=null;
Map<String, Object> returnData = new HashMap<>();
List<StatsVo> yearMarriedCouple = hyStatsDao.getYearMarriedCouple(vo);
for (StatsVo statsVo:yearMarriedCouple) {
if ("IA".equals(statsVo.getType())) {
iaCount = statsVo.getNum();
} else if ("IB".equals(statsVo.getType())) {
ibCount = statsVo.getNum();
}
}
returnData.put("结婚对数",iaCount);
returnData.put("离婚对数",ibCount);
return returnData;
}
}
......@@ -18,6 +18,10 @@ public class SearchReqVo extends PageReqVo {
private String keyword;
private String IAcount;
private String IBcount;
public String getAreaCode() {
return SystemArea.patchZero(areaCode);
}
......
......@@ -85,8 +85,9 @@
SELECT LEFT(UNIT_ID, #{size}) 'code', APPLY_TYPE_ID 'type', GRANT_YEAR 'year', COUNT_PEOPLE 'num', SUM_MONEY
'amount'
FROM `statics_grant`
WHERE DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant ORDER BY create_time DESC LIMIT 1)
AND CHAR_LENGTH (LEFT ( UNIT_ID, #{size} )) = #{size}
WHERE
# DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant ORDER BY create_time DESC LIMIT 1)
CHAR_LENGTH (LEFT ( UNIT_ID, #{size} )) = #{size}
<if test="year != null">
AND GRANT_YEAR = #{year}
</if>
......@@ -120,8 +121,9 @@
<select id="getYearIssueStats" resultType="com.zq.portal.vo.StatsVo">
SELECT APPLY_TYPE_ID 'type', GRANT_YEAR 'year', SUM( COUNT_PEOPLE ) 'num', SUM( SUM_MONEY ) 'amount'
FROM `statics_grant`
WHERE DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant
ORDER BY create_time DESC LIMIT 1)
WHERE 1=1
# DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant
# ORDER BY create_time DESC LIMIT 1)
<if test="subAreaCode != null and subAreaCode != ''">
AND UNIT_ID LIKE CONCAT( #{subAreaCode}, '%' )
</if>
......
......@@ -175,5 +175,20 @@
</if>
ORDER BY registerDate DESC
</select>
<select id="getYearMarriedCouple" resultType="com.zq.portal.vo.StatsVo">
SELECT
COUNT( 1 )
FROM
MRCASE m
WHERE
1=1
<if test="type != null and type != ''">
AND m.AIAX0001 = #{type}
</if>
AND BIAX0075 = '1'
AND AIAX0072 = '1'
AND DATE_FORMAT(AIAX0048,'%Y%m') >= '202201'
AND DATE_FORMAT(AIAX0048,'%Y%m') &lt;= '202212'
</select>
</mapper>
......@@ -200,7 +200,7 @@
LEFT ( a.area_code, #{size} ) 'code',
a.type 'type',
SUM(a.people_num) 'num'
FROM city_coutry_2021 a
FROM city_coutry a
WHERE
CHAR_LENGTH (LEFT ( a.area_code, #{size} )) = #{size}
<if test="subAreaCode != null and subAreaCode != ''">
......
package com.zq.resource.controller;
import com.zq.common.annotation.AnonymousAccess;
import com.zq.common.utils.AssertUtils;
import com.zq.common.vo.IdVo;
import com.zq.common.vo.PageVo;
......@@ -74,6 +75,7 @@ public class DeptController {
@ApiOperation("机构注册")
@PostMapping(value = "/share/registerDept")
@AnonymousAccess
public ResultVo registerDept(@RequestBody IdVo vo) {
AssertUtils.notEmpty(vo.getIds(), "至少选择一项");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment