Browse Source

Merge remote-tracking branch 'origin/dev_optimize' into develop

# Conflicts:
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
dev
yinzuomei 3 years ago
parent
commit
322d5f45a7
  1. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  2. 39
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  3. 16
      pom.xml

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java

@ -20,6 +20,8 @@ public interface ImportErrorMsgConstants {
String BUILDING_TYPE_ERROR = "楼栋类型的值未填写或者所填写信息在系统中未找到";
String NEIGHBORHOOD_TYPE_ERROR = "小区名称的值未填写或者所填写信息在系统中未找到";
String HOUSE_ERROR_NAME = "导入失败的列表-房屋";
String BUILDING_ERROR_NAME = "导入失败的列表-楼栋";
String NEIGHBORHOOD_ERROR_NAME = "导入失败的列表-小区";
}

39
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -17,6 +17,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -553,24 +554,26 @@ public class BuildingServiceImpl implements BuildingService {
Integer unit = icBuilding.getTotalUnitNum();
if(nowUnit<unit){
//如果小于,判断是否存在房屋,如果存在就提示不能更改
throw new EpmetException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"暂不支持单元号减小");
}
//新增单元
List<OptionResultDTO> units = icBuildingUnitService.getUnitOptions(icBuilding.getId());
Map<String, String> unitMap = units.stream().collect(Collectors.toMap(OptionResultDTO::getCode, OptionResultDTO::getLabel));
List<IcBuildingUnitEntity> unitList = new ArrayList<>();
for (int i = 1; i <= nowUnit; i++) {
String unitNum = String.valueOf(i);
if (!unitMap.containsKey(unitNum)) {
IcBuildingUnitEntity icBuildingUnit = new IcBuildingUnitEntity();
icBuildingUnit.setBuildingId(icBuilding.getId());
icBuildingUnit.setCustomerId(customerId);
icBuildingUnit.setUnitName(unitNum + "单元");
icBuildingUnit.setUnitNum(unitNum);
unitList.add(icBuildingUnit);
throw new EpmetException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),EpmetErrorCode.ORG_EDIT_FAILED.getMsg(),"暂不支持单元号减小");
}else{
//新增单元
List<OptionResultDTO> units = icBuildingUnitService.getUnitOptions(icBuilding.getId());
Map<String, String> unitMap = units.stream().collect(Collectors.toMap(OptionResultDTO::getCode, OptionResultDTO::getLabel));
List<IcBuildingUnitEntity> unitList = new ArrayList<>();
for (int i = 1; i <= nowUnit; i++) {
String unitNum = String.valueOf(i);
if (!unitMap.containsKey(unitNum)) {
IcBuildingUnitEntity icBuildingUnit = new IcBuildingUnitEntity();
icBuildingUnit.setBuildingId(icBuilding.getId());
icBuildingUnit.setCustomerId(customerId);
icBuildingUnit.setUnitName(unitNum + "单元");
icBuildingUnit.setUnitNum(unitNum);
unitList.add(icBuildingUnit);
}
icBuildingUnitService.insertBatch(unitList);
}
}
icBuildingUnitService.insertBatch(unitList);
//删除楼栋下所有的房屋缓存
List<IcHouseEntity> houseList = icHouseDao.selectList(new QueryWrapper<IcHouseEntity>().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId()));
if (!CollectionUtils.isEmpty(houseList)) {
@ -579,8 +582,8 @@ public class BuildingServiceImpl implements BuildingService {
icHouseRedis.delHouseInfo(house.getId(), customerId);
});
}
//删除楼栋缓存
CustomerIcHouseRedis.delBuildingInfo(formDTO.getBuildingId());
}
/**

16
pom.xml

@ -97,11 +97,6 @@
</dependencyManagement>
<repositories>
<!--<repository>
<id>mvnrepo</id>
<name>jianjun gitee</name>
<url>https://gitee.com/jianjun4833/mvnrepo/blob/master/</url>
</repository>-->
<repository>
<id>public</id>
<name>aliyun nexus</name>
@ -110,6 +105,11 @@
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>epmet</id>
<name>maven-releases</name>
<url>https://nexus.elinkservice.cn/repository/maven-releases/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
@ -124,5 +124,11 @@
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>epmet</id>
<url>https://nexus.elinkservice.cn/repository/maven-releases/</url>
</repository>
</distributionManagement>
</project>

Loading…
Cancel
Save