huanghongfa
2021-07-23 1a69de7ac9d58ad8482b1540e13ee66b1adae291
Merge remote-tracking branch 'origin/test' into test
4个文件已修改
71 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngPopulationDTO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWorkGuideServiceImpl.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngPopulationDTO.java
@@ -44,6 +44,7 @@
     */
    @ApiModelProperty(value = "最终年龄开始时间查询字段",hidden = true)
    private String ageStartTimeEnd;
    /**
     * 年龄结束查询字段
     */
@@ -51,6 +52,12 @@
    private String ageEnd;
    /**
     * 最终年龄结束时间查询字段
     */
    @ApiModelProperty(value = "最终年龄结束时间查询字段",hidden = true)
    private String ageEndTimeEnd;
    /**
     * 年龄结束时间查询字段
     */
    @ApiModelProperty(value = "年龄结束时间查询字段",hidden = true)
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -207,6 +207,9 @@
            "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime == comMngPopulationVO.ageEndTime'>" +
            "AND cmp.birthday BETWEEN #{comMngPopulationVO.ageStartTimeEnd} and #{comMngPopulationVO.ageEndTime}" +
            " </if> " +
            "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime != comMngPopulationVO.ageEndTime'>" +
            "AND cmp.birthday BETWEEN #{comMngPopulationVO.ageEndTimeEnd} and #{comMngPopulationVO.ageStartTime}" +
            " </if> " +
            "<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != &quot;&quot;'>" +
            "AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " +
            " </if> " +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWorkGuideServiceImpl.java
@@ -112,12 +112,10 @@
        if (comActDO != null){
            vo.setAddress(comActDO.getAddress());
            vo.setPhone(comActDO.getContactsPhone());
            vo.setLon(comActDO.getLng());
            vo.setLat(comActDO.getLat());
        }
//        List<String> list = getCoordinate(vo.getAddress());
//        if (list !=null && list.size() > 0){
//            vo.setLon(list.get(0));
//            vo.setLat(list.get(1));
//        }
        List<ComActWorkGuideMaterialDO> workGuideMaterialDOS = workGuideMaterialDAO.selectList(new LambdaQueryWrapper<ComActWorkGuideMaterialDO>()
                .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideId));
        workGuideMaterialDOS.forEach(workGuideMaterialDO -> {
@@ -153,47 +151,4 @@
                .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideId));
        return R.ok();
    }
//    // 调用百度地图API根据地址,获取坐标
//    public static List<String> getCoordinate(String address) {
//        List<String> list = new ArrayList<>();
//        if (address != null && !"".equals(address)) {
//            address = address.replaceAll("\\s*", "").replace("#", "栋");
//            String url = "http://api.map.baidu.com/geocoder/v3/?address=" + address + "&output=json&ak=" + AK;
//            String json = loadJSON(url);
////            json = "{" + json;
////            json = json + "}";
//            if (json != null && !"".equals(json)) {
//                XMLSerializer xmlSerializer = new XMLSerializer();
//                //将xml转为json(注:如果是元素的属性,会在json里的key前加一个@标识)
//                String result = xmlSerializer.read(json).toString();
//                JSONObject obj = JSONObject.parseObject(json);
//                if ("0".equals(obj.getString("status"))) {
//                    double lng = obj.getJSONObject("result").getJSONObject("location").getDouble("lng"); // 经度
//                    double lat = obj.getJSONObject("result").getJSONObject("location").getDouble("lat"); // 纬度
//                    DecimalFormat df = new DecimalFormat("#.######");
//                    list.add(df.format(lng));
//                    list.add(df.format(lat));
//                    return list;
//                }
//            }
//        }
//        return null;
//    }
//
//    public static String loadJSON(String url) {
//        StringBuilder json = new StringBuilder();
//        try {
//            URL oracle = new URL(url);
//            URLConnection yc = oracle.openConnection();
//            BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "UTF-8"));
//            String inputLine = null;
//            while ((inputLine = in.readLine()) != null) {
//                json.append(inputLine);
//            }
//            in.close();
//        } catch (MalformedURLException e) {} catch (IOException e) {}
//        return json.toString();
//    }
}
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);