From 342757cba6c54dc315be93c94a13a8f30c1e2591 Mon Sep 17 00:00:00 2001 From: tangxiaobao <303826152@qq.com> Date: 星期五, 23 七月 2021 16:20:27 +0800 Subject: [PATCH] 社区后台基础数据库bug修改 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java index 7dbc9ef..d1cf948 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java @@ -300,11 +300,17 @@ } if (comMngPopulationVO.getAgeStartTime() !=null && !"".equals(comMngPopulationVO.getAgeStartTime()) && comMngPopulationVO.getAgeEndTime() !=null && !"".equals(comMngPopulationVO.getAgeEndTime())){ if (comMngPopulationVO.getAgeStartTime().equals(comMngPopulationVO.getAgeEndTime())) { - Date endAge = DateUtils.stringToDate(comMngPopulationVO.getAgeEndTime(),new SimpleDateFormat("yyyy-MM-dd")); - String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(endAge, -1),"yyyy-MM-dd"); + Date endAge = DateUtils.stringToDate(comMngPopulationVO.getAgeEndTime(), new SimpleDateFormat("yyyy-MM-dd")); + String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(endAge, -1), "yyyy-MM-dd"); if (StringUtils.isNotEmpty(ageStartTime)) { comMngPopulationVO.setAgeStartTimeEnd(ageStartTime); } + } else { + Date endAge = DateUtils.stringToDate(comMngPopulationVO.getAgeEndTime(), new SimpleDateFormat("yyyy-MM-dd")); + String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(endAge, -1), "yyyy-MM-dd"); + if (StringUtils.isNotEmpty(ageStartTime)) { + comMngPopulationVO.setAgeEndTimeEnd(ageStartTime); + } } } IPage<ComMngPopulationVO> iPage = populationDAO.pagePopulation(page, comMngPopulationVO); -- Gitblit v1.7.1