huanghongfa
2021-06-02 7aa165a3de1fa1878ee5d55512faeb7134c05692
修改bug
4个文件已修改
60 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngPopulationDTO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngPopulationDTO.java
@@ -32,6 +32,12 @@
     */
    @ApiModelProperty("年龄开始查询字段")
    private String ageStart;
    /**
     * 年龄开始时间查询字段
     */
    @ApiModelProperty(value = "年龄开始时间查询字段",hidden = true)
    private String ageStartTime;
    /**
     * 年龄结束查询字段
     */
@@ -39,6 +45,12 @@
    private String ageEnd;
    /**
     * 年龄结束时间查询字段
     */
    @ApiModelProperty(value = "年龄结束时间查询字段",hidden = true)
    private String ageEndTime;
    /**
     * 籍贯
     */
    @ApiModelProperty("籍贯")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java
@@ -594,6 +594,27 @@
        }
    }
    /**
     * 日期相加减
     * @param time
     *             时间字符串 yyyy-MM-dd HH:mm:ss
     * @param num
     *             加的数,-num就是减去
     * @return
     *             减去相应的数量的年的日期
     * @throws ParseException
     */
    public static Date yearAddNum(Date time, Integer num) {
        //SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //Date date = format.parse(time);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(time);
        calendar.add(Calendar.YEAR, num);
        Date newTime = calendar.getTime();
        return newTime;
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -174,11 +174,11 @@
            "<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex != &quot;&quot;'>" +
            "AND cmp.sex = #{comMngPopulationVO.sex} " +
            " </if> " +
            "<if test='comMngPopulationVO.ageStart != null and comMngPopulationVO.ageStart != &quot;&quot;'>" +
            "AND cmp.age <![CDATA[ >= ]]> #{comMngPopulationVO.ageStart} " +
            "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != &quot;&quot;'>" +
            "AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ >= ]]> #{comMngPopulationVO.ageStartTime} " +
            " </if> " +
            "<if test='comMngPopulationVO.ageEnd != null and comMngPopulationVO.ageEnd != &quot;&quot;'>" +
            "AND cmp.age <![CDATA[ <= ]]> #{comMngPopulationVO.ageEnd} " +
            "<if test='comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageEndTime != &quot;&quot;'>" +
            "AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ <= ]]> #{comMngPopulationVO.ageEndTime} " +
            " </if> " +
            "<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != &quot;&quot;'>" +
            "AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -17,9 +17,7 @@
import com.panzhihua.common.model.vos.area.AreaAddressVO;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.user.*;
import com.panzhihua.common.utlis.AgeUtils;
import com.panzhihua.common.utlis.IdCard;
import com.panzhihua.common.utlis.PayUtil;
import com.panzhihua.common.utlis.*;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.model.dos.*;
import com.panzhihua.service_community.service.ComMngPopulationHouseUserService;
@@ -31,7 +29,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import com.panzhihua.common.utlis.StringUtils;
import javax.annotation.Resource;
import javax.crypto.BadPaddingException;
@@ -234,6 +231,20 @@
            }
        }
        if(StringUtils.isNotEmpty(comMngPopulationVO.getAgeStart())){
            String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(new Date(),-(Integer.parseInt(comMngPopulationVO.getAgeStart()))),"yyyy-MM-dd");
            if(StringUtils.isNotEmpty(ageStartTime)){
                comMngPopulationVO.setAgeStartTime(ageStartTime);
            }
        }
        if(StringUtils.isNotEmpty(comMngPopulationVO.getAgeEnd())){
            String ageEndTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(new Date(),-(Integer.parseInt(comMngPopulationVO.getAgeEnd()))),"yyyy-MM-dd");
            if(StringUtils.isNotEmpty(ageEndTime)){
                comMngPopulationVO.setAgeEndTime(ageEndTime);
            }
        }
        IPage<ComMngPopulationVO> iPage = populationDAO.pagePopulation(page, comMngPopulationVO);
        if(!iPage.getRecords().isEmpty()){
            iPage.getRecords().forEach(populDO -> {