diff --git a/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/School.java b/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/School.java index 457d3e8..912d3e8 100644 --- a/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/School.java +++ b/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/School.java @@ -127,9 +127,6 @@ public class School { if(school_address != null && school_address.length() > 255 ) { throw new ParamsException("学校地址超出长度"); } - if(StringUtils.isEmpty(running_type_name)) { - throw new ParamsException("学校办学类型名不能为空"); - } if(running_type_name != null && running_type_name.length() > 20 ) { throw new ParamsException("学校办学类型超出长度"); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/grid/impl/GridServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/grid/impl/GridServiceImpl.java index 27c1d95..abe648b 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/grid/impl/GridServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/grid/impl/GridServiceImpl.java @@ -60,14 +60,17 @@ public class GridServiceImpl extends DefaultBaseService implements IGridService @Override public String getLocationArea(String locationCode) { String locationArea = ""; + System.out.println("locationCode = " + locationCode); AreaDTO areaDTO = mongoAreaService.getByCode(locationCode); Integer level = Integer.valueOf(areaDTO.getAreaLevel()); Integer parentId = Integer.valueOf(areaDTO.getAreaParentId()); String areaName = areaDTO.getAreaName(); locationArea = areaName; - if(0 != level && 2 != level) { + if(0 != level && 2 != level && level > 1) { for(int i=1;i<=5;i++) { + System.out.println("parentId.toString() = " + parentId.toString()); areaDTO = mongoAreaService.get(parentId.toString()); + System.out.println("areaDTO.toString() = " + areaDTO.toString()); level = Integer.valueOf(areaDTO.getAreaLevel()); parentId = Integer.valueOf(areaDTO.getAreaParentId()); areaName = areaDTO.getAreaName(); diff --git a/src/main/java/cn/com/tenlion/systembase/service/school/impl/SchoolServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/school/impl/SchoolServiceImpl.java index 4a40c6e..96f3c83 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/school/impl/SchoolServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/school/impl/SchoolServiceImpl.java @@ -253,21 +253,38 @@ public class SchoolServiceImpl extends DefaultBaseService implements ISchoolServ String locationArea = gridService.getLocationArea(schoolVO.getLocationCode()); school.setlocation_area(locationArea); // 经度 - school.setlongitude(schoolVO.getLongitude().toString()); + if(null != schoolVO.getLongitude()) { + school.setlongitude(schoolVO.getLongitude().toString()); + }else { + school.setlongitude("暂无数据"); + } // 纬度 - school.setlatitude(schoolVO.getLatitude().toString()); - GridDTO gridDTO = gridService.get(schoolVO.getGrid()); - if(null != gridDTO) { - // 网格名称 - school.setgrid_name(gridDTO.getGridName()); - // 网格编码 - school.setgrid_code(gridDTO.getGridCode()); + if(null != schoolVO.getLatitude()) { + school.setlatitude(schoolVO.getLatitude().toString()); + }else { + school.setlatitude("暂无数据"); + } + + if(null != schoolVO.getGrid()) { + GridDTO gridDTO = gridService.get(schoolVO.getGrid()); + if(null != gridDTO) { + // 网格名称 + school.setgrid_name(gridDTO.getGridName()); + // 网格编码 + school.setgrid_code(gridDTO.getGridCode()); + }else { + // 网格名称 + school.setgrid_name("暂无数据"); + // 网格编码 + school.setgrid_code("暂无数据"); + } }else { // 网格名称 school.setgrid_name("暂无数据"); // 网格编码 school.setgrid_code("暂无数据"); } + return school; } diff --git a/src/main/java/cn/com/tenlion/systembase/util/fullsync/FullSyncC0012.java b/src/main/java/cn/com/tenlion/systembase/util/fullsync/FullSyncC0012.java index 1e22db2..8325c3e 100644 --- a/src/main/java/cn/com/tenlion/systembase/util/fullsync/FullSyncC0012.java +++ b/src/main/java/cn/com/tenlion/systembase/util/fullsync/FullSyncC0012.java @@ -37,7 +37,7 @@ public class FullSyncC0012 implements ApplicationEventPublisherAware { public FullSyncC0012() {} - @KafkaListener(topics = "C0032FullSync") + @KafkaListener(topics = "C0012FullSync") public void message(ConsumerRecord record) { System.out.println("收到全量同步命令"); JSONObject jsonObject = JSONObject.parseObject(record.value().toString()); @@ -61,7 +61,7 @@ public class FullSyncC0012 implements ApplicationEventPublisherAware { } } - @KafkaListener(topics = "C0032") + @KafkaListener(topics = "C0012") public void messageMsg(ConsumerRecord record) { JSONObject jsonObject = JSONObject.parseObject(record.value().toString()); Map params = new HashMap<>();