|
@@ -38,8 +38,9 @@ public class ParkRoomListener extends AnalysisEventListener<ParkRoomExcel> {
|
|
|
private SysDictService sysDictService;
|
|
|
|
|
|
|
|
|
- public ParkRoomListener(MnpBuildingService buildingService, ParkFloorDiscService floorDiscService,
|
|
|
- ParkInfoService parkInfoService, SysDictService sysDictService, JSONObject jsonObject) {
|
|
|
+ public ParkRoomListener(ParkRoomService roomService, MnpBuildingService buildingService, ParkFloorDiscService floorDiscService,
|
|
|
+ ParkInfoService parkInfoService,SysDictService sysDictService, JSONObject jsonObject) {
|
|
|
+ this.roomService = roomService;
|
|
|
this.buildingService = buildingService;
|
|
|
this.floorDiscService = floorDiscService;
|
|
|
this.parkInfoService = parkInfoService;
|
|
@@ -90,14 +91,15 @@ public class ParkRoomListener extends AnalysisEventListener<ParkRoomExcel> {
|
|
|
}
|
|
|
data.setGroupId(parkNameIdMap.get(excel.getGroupName()));
|
|
|
// 判断分期是否存在
|
|
|
- if(StringUtils.isEmpty(discNameIdMap.get(excel.getGroupName()))){
|
|
|
+ if(StringUtils.isEmpty(discNameIdMap.get(excel.getDiscName()))){
|
|
|
throw new RuntimeException("分期不存在");
|
|
|
}
|
|
|
- data.setDiscId(discNameIdMap.get(excel.getGroupName()));
|
|
|
+ data.setDiscId(discNameIdMap.get(excel.getDiscName()));
|
|
|
// 判断楼栋是否存在
|
|
|
if(StringUtils.isEmpty(buildNameIdMap.get(excel.getBuildNum()))){
|
|
|
throw new RuntimeException("楼栋不存在");
|
|
|
}
|
|
|
+ data.setBuildId(buildNameIdMap.get(excel.getBuildNum()));
|
|
|
// 户室号
|
|
|
if (StringUtils.isEmpty(excel.getRoomNo())) {
|
|
|
throw new RuntimeException("户室号为空");
|
|
@@ -183,50 +185,48 @@ public class ParkRoomListener extends AnalysisEventListener<ParkRoomExcel> {
|
|
|
}
|
|
|
// 用途
|
|
|
if (StringUtils.isNotEmpty(excel.getRoomUse())) {
|
|
|
- throw new RuntimeException("用途为空");
|
|
|
- }
|
|
|
- for (Map<String, String> stringStringMap : houseUsage) {
|
|
|
- if (stringStringMap.get("label").equals(excel.getRoomUse())) {
|
|
|
- data.setRoomUse(Integer.valueOf(stringStringMap.get("value")));
|
|
|
+ for (Map<String, String> stringStringMap : houseUsage) {
|
|
|
+ if (stringStringMap.get("label").equals(excel.getRoomUse())) {
|
|
|
+ data.setRoomUse(Integer.valueOf(stringStringMap.get("value")));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 没匹配上的情况
|
|
|
+ if(data.getRoomUse() == null){
|
|
|
+ throw new RuntimeException("用途格式有误");
|
|
|
}
|
|
|
- }
|
|
|
- // 没匹配上的情况
|
|
|
- if(data.getRoomUse() == null){
|
|
|
- throw new RuntimeException("用途格式有误");
|
|
|
}
|
|
|
// 户编号
|
|
|
- if (StringUtils.isNotEmpty(excel.getRoomNumber())) {
|
|
|
+ if (StringUtils.isEmpty(excel.getRoomNumber())) {
|
|
|
throw new RuntimeException("户编号为空");
|
|
|
}
|
|
|
data.setRoomNumber(excel.getRoomNumber());
|
|
|
// 装修情况
|
|
|
if (StringUtils.isNotEmpty(excel.getDecorationSituation())) {
|
|
|
- throw new RuntimeException("装修情况为空");
|
|
|
- }
|
|
|
- for (Map<String, String> stringStringMap : decorationSituation) {
|
|
|
- if (stringStringMap.get("label").equals(excel.getDecorationSituation())) {
|
|
|
- data.setDecorationSituation(Integer.valueOf(stringStringMap.get("value")));
|
|
|
+ for (Map<String, String> stringStringMap : decorationSituation) {
|
|
|
+ if (stringStringMap.get("label").equals(excel.getDecorationSituation())) {
|
|
|
+ data.setDecorationSituation(Integer.valueOf(stringStringMap.get("value")));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 没匹配上的情况
|
|
|
+ if(data.getDecorationSituation() == null){
|
|
|
+ throw new RuntimeException("装修情况格式有误");
|
|
|
}
|
|
|
}
|
|
|
- // 没匹配上的情况
|
|
|
- if(data.getDecorationSituation() == null){
|
|
|
- throw new RuntimeException("装修情况格式有误");
|
|
|
- }
|
|
|
- data.setRemark(excel.getRemark());
|
|
|
// 可售状态
|
|
|
if (StringUtils.isNotEmpty(excel.getSaleStatus())) {
|
|
|
- throw new RuntimeException("可售状态为空");
|
|
|
- }
|
|
|
- for (Map<String, String> stringStringMap : saleStatus) {
|
|
|
- if (stringStringMap.get("label").equals(excel.getSaleStatus())) {
|
|
|
- data.setSaleStatus(Integer.valueOf(stringStringMap.get("value")));
|
|
|
+ for (Map<String, String> stringStringMap : saleStatus) {
|
|
|
+ if (stringStringMap.get("label").equals(excel.getSaleStatus())) {
|
|
|
+ data.setSaleStatus(Integer.valueOf(stringStringMap.get("value")));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 没匹配上的情况
|
|
|
+ if(data.getSaleStatus() == null){
|
|
|
+ throw new RuntimeException("可售状态格式有误");
|
|
|
}
|
|
|
}
|
|
|
- // 没匹配上的情况
|
|
|
- if(data.getSaleStatus() == null){
|
|
|
- throw new RuntimeException("可售状态格式有误");
|
|
|
- }
|
|
|
+ // TODO: 2024/9/11 户型处理
|
|
|
data.setId(IdUtil.simpleUUID());
|
|
|
+ data.setRemark(excel.getRemark());
|
|
|
data.setCreatedId(ShiroUtils.getUserId());
|
|
|
data.setCreatedAt(new Date());
|
|
|
list.add(data);
|