Browse Source

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

master
yinzuomei 3 years ago
parent
commit
bcf274d079
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  2. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  3. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  4. 47
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  6. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  8. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java
  9. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserExcel.java
  10. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java
  11. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

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

@ -16,7 +16,7 @@ public interface ImportErrorMsgConstants {
String NEIGHBOR_HOOD_ERROR = "所属组织、所属网格、详细地址的值未填写,或者所填写信息在系统中未找到";
String HOUSE_ERROR_NAME = "导入失败的列表-房屋";
String BUILDING_ERROR_NAME = "导入失败的列表-楼";
String BUILDING_ERROR_NAME = "导入失败的列表-楼";
String NEIGHBORHOOD_ERROR_NAME = "导入失败的列表-小区";
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -136,7 +136,7 @@ public class BuildingController {
TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",new ArrayList<IcBuildingExcel>());
ExcelPoiUtils.exportExcel(templatePath ,map,"楼信息录入表",response);
ExcelPoiUtils.exportExcel(templatePath ,map,"楼信息录入表",response);
}
/**

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -31,7 +31,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
@ -40,9 +39,7 @@ import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.excel.IcHouseExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.HouseService;
import com.epmet.service.IcHouseService;
import com.epmet.util.ExcelPoiUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -76,12 +73,6 @@ public class HouseController implements ResultDataResolver {
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Autowired
private IcBuildingDao icBuildingDao;
@Autowired
private IcHouseRedis icHouseRedis;
@Autowired
private IcHouseService icHouseService;
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@ -239,6 +230,8 @@ public class HouseController implements ResultDataResolver {
return new Result().ok(str);
}
@PostMapping("queryListHouseInfo")
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId) {
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds, customerId));

47
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -19,15 +19,8 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
@ -36,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
@ -48,45 +40,10 @@ import java.util.Map;
@RestController
@RequestMapping("ichouse")
public class IcHouseController {
@Autowired
private IcHouseService icHouseService;
@GetMapping("page")
public Result<PageData<IcHouseDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcHouseDTO> page = icHouseService.page(params);
return new Result<PageData<IcHouseDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcHouseDTO> get(@PathVariable("id") String id){
IcHouseDTO data = icHouseService.get(id);
return new Result<IcHouseDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IcHouseDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icHouseService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IcHouseDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icHouseService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icHouseService.delete(ids);
return new Result();
}
@PostMapping("houseoption")
public Result<List<OptionResultDTO>> getHouseOption(@RequestBody HouseFormDTO formDTO){
return new Result<List<OptionResultDTO>>().ok(icHouseService.getHouseOption(formDTO));
@ -126,4 +83,4 @@ public class IcHouseController {
return new Result<List<HousesNameResultDTO>>().ok(icHouseService.getHousesNameByIdCards(idCards));
}
}
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -114,7 +114,7 @@ public class NeighborHoodController {
//判断是否存在楼宇,如果存在不能删除
List<IcBuildingEntity> icBuildingEntities = icBuildingDao.selectList(new QueryWrapper<IcBuildingEntity>().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId));
if(!CollectionUtils.isEmpty(icBuildingEntities)){
return new Result().error(8001,"小区下已存在楼,无法删除");
return new Result().error(8001,"小区下已存在楼,无法删除");
}
neighborHoodService.delNeighborhood(neighborHoodId);
return new Result().ok("删除成功");

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

@ -402,7 +402,7 @@ public class BuildingServiceImpl implements BuildingService {
TemplateExportParams templatePath = new TemplateExportParams("excel/building_export.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",icBuildingExcels);
ExcelPoiUtils.exportExcel(templatePath ,map,"楼信息录入表",response);
ExcelPoiUtils.exportExcel(templatePath ,map,"楼信息录入表",response);
return ;
}
@Override
@ -535,7 +535,7 @@ public class BuildingServiceImpl implements BuildingService {
List<IcHouseEntity> icHouseEntities = icHouseDao.selectList(new QueryWrapper<IcHouseEntity>().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId()));
if(!CollectionUtils.isEmpty(icHouseEntities)){
//
throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼单元下存在房屋,无法更新");
throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼单元下存在房屋,无法更新");
// icHouseEntities.forEach(item->{
// item.setNeighborHoodId(formDTO.getNeighborHoodId());
// });
@ -564,7 +564,7 @@ public class BuildingServiceImpl implements BuildingService {
icBuildingUnitService.insertBatch(unitList);
}else{
//如果小于,判断是否存在房屋,如果存在就提示不能更改
throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼单元下存在房屋,无法更新");
throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼单元下存在房屋,无法更新");
}
@ -581,7 +581,7 @@ public class BuildingServiceImpl implements BuildingService {
//如果存在房屋,无法删除
List<IcHouseEntity> icHouseEntities = icHouseDao.selectList(new QueryWrapper<IcHouseEntity>().lambda().eq(IcHouseEntity::getBuildingId, buildingId));
if(!CollectionUtils.isEmpty(icHouseEntities)){
throw new RenException(EpmetErrorCode.ORG_DEL_FAILED.getCode(),"楼单元下存在房屋,无法删除");
throw new RenException(EpmetErrorCode.ORG_DEL_FAILED.getCode(),"楼单元下存在房屋,无法删除");
}
//删除楼宇
icBuildingService.deleteById(buildingId);

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -411,7 +411,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
if (!CollectionUtils.isEmpty(exists)){
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼信息,暂无法删除",collect));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)){

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiWarnFormDTO.java

@ -59,7 +59,7 @@ public class StatsResiWarnFormDTO implements Serializable {
@NotBlank(message = "配置id不能为空",groups = {ListSelectedUser.class})
private String configId;
@NotNull(message = "楼不能为空",groups = {ListSelectedUser.class})
@NotNull(message = "楼不能为空",groups = {ListSelectedUser.class})
private List<String> buildingIdList;

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserExcel.java

@ -49,7 +49,7 @@ public class IcResiUserExcel {
@Excel(name = "所属小区ID")
private String villageId;
@Excel(name = "所属楼Id")
@Excel(name = "所属楼Id")
private String buildId;
@Excel(name = "所属家庭Id")

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcStatsResiWarnExcel.java

@ -52,7 +52,7 @@ public class IcStatsResiWarnExcel {
@Excel(name = "小区id")
private String neighborHoodId;
@Excel(name = "楼id")
@Excel(name = "楼id")
private String buildingId;
@Excel(name = "该分类的居民数量")

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -150,7 +150,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
//feign根据buildingIdList 获取网格,小区,楼宇 信息
Result<BuildingResultPagedDTO> buildingPageList = govOrgOpenFeignClient.buildinglistbyidsPage(buildingIdList,pageNo,pageSize);
if (!buildingPageList.success() || null == buildingPageList.getData()) {
throw new RenException("楼信息查询失败,buildingList="+ JSON.toJSONString(buildingIdList));
throw new RenException("楼信息查询失败,buildingList="+ JSON.toJSONString(buildingIdList));
}
BuildingResultPagedDTO pageData = buildingPageList.getData();
List<BuildingResultDTO> buildingResultDTOList = pageData.getList();

Loading…
Cancel
Save