diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java index 15ba83ef46..1090af5ae3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcBuildingController.java @@ -18,20 +18,16 @@ package com.epmet.controller; import com.epmet.commons.tools.dto.result.OptionResultDTO; -import com.epmet.commons.tools.page.PageData; 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.IcBuildingDTO; import com.epmet.service.IcBuildingService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; -import java.util.Map; /** @@ -43,46 +39,10 @@ import java.util.Map; @RestController @RequestMapping("icbuilding") public class IcBuildingController { - + @Autowired private IcBuildingService icBuildingService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icBuildingService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - IcBuildingDTO data = icBuildingService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody IcBuildingDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icBuildingService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody IcBuildingDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icBuildingService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icBuildingService.delete(ids); - return new Result(); - } - /** * @Description 获取小区内的楼栋 * @Param dto @@ -94,4 +54,4 @@ public class IcBuildingController { public Result> getBuildingOptions(@RequestBody IcBuildingDTO dto) { return new Result>().ok(icBuildingService.getBuildingOptions(dto.getNeighborHoodId())); } -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java deleted file mode 100644 index be6ba11d2f..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.excel; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import com.epmet.util.ExcelVerifyInfo; -import lombok.Data; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 房屋信息 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2021-10-27 - */ -@Data -public class IcHouseExcel extends ExcelVerifyInfo implements Serializable { - - /*@Excel(name = "房屋主键") - private String id; - - @Excel(name = "客户id") - private String customerId; - - @Excel(name = "小区id") - private String neighborHoodId; - - @Excel(name = "片区id,neighbor_hood_part.id,可为空。") - private String partId; - - @Excel(name = "所属楼栋id") - private String buildingId; - - @Excel(name = "所属单元id") - private String buildingUnitId; - - @Excel(name = "房屋名字后台插入时生成") - private String houseName; - - @Excel(name = "门牌号") - private String doorName; - - @Excel(name = "房屋类型,这里存储字典value就可以") - private String houseType; - - @Excel(name = "存储字典value") - private String purpose; - - @Excel(name = "1出租;0未出租") - private Integer rentFlag; - - @Excel(name = "房主姓名") - private String ownerName; - - @Excel(name = "房主电话") - private String ownerPhone; - - @Excel(name = "房主身份证号") - private String ownerIdCard; - - @Excel(name = "删除标识 0未删除、1已删除") - private String delFlag; - - @Excel(name = "乐观锁") - private Integer revision; - - @Excel(name = "创建人") - private String createdBy; - - @Excel(name = "创建时间") - private Date createdTime; - - @Excel(name = "更新人") - private String updatedBy; - - @Excel(name = "更新时间") - private Date updatedTime;*/ - - @Excel(name = "所属组织") - @NotBlank(message = "不能为空") - private String agencyName; - - @Excel(name = "所属网格") - @NotBlank(message = "不能为空") - private String gridName; - - @Excel(name = "所属小区") - @NotBlank(message = "不能为空") - @Length(max=50,message = "不能超过50个字") - private String neighborHoodName; - - @Excel(name = "所属楼栋") - @NotBlank(message = "不能为空") - private String buildingName; - - @Excel(name = "单元号") - @NotNull(message = "不能为空") - private Integer buildingUnit; - - @Excel(name = "门牌号") - @NotBlank(message = "不能为空") - private String doorName; - - @Excel(name = "房屋类型") - @NotBlank(message = "不能为空") - private String houseType; - - @Excel(name = "房屋用途") - @NotBlank(message = "不能为空") - private String purpose; - - @Excel(name = "出租") - @NotBlank(message = "不能为空") - private String rentFlag; - - @Excel(name = "房主姓名") - @NotBlank(message = "不能为空") - private String ownerName; - - @Excel(name = "房主电话") - @NotBlank(message = "不能为空") - private String ownerPhone; - - @Excel(name = "房主身份证") - @NotBlank(message = "不能为空") - private String ownerIdCard; - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index 0caa4a5c71..c0ce3e9bd3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -23,7 +23,10 @@ import com.epmet.dao.*; import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.*; +import com.epmet.dto.result.BuildingResultDTO; +import com.epmet.dto.result.BuildingResultPagedDTO; +import com.epmet.dto.result.IcBuildingListResultDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.entity.*; import com.epmet.enums.BuildingTypeEnums; import com.epmet.excel.IcBuildingExcel; @@ -31,7 +34,10 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.model.BuildingInfoModel; import com.epmet.model.ImportBuildingInfoListener; import com.epmet.redis.IcHouseRedis; -import com.epmet.service.*; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcNeighborHoodService; import com.epmet.util.ExcelPoiUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -44,7 +50,6 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.io.InputStream; import java.util.*; import java.util.concurrent.ExecutorService; @@ -60,15 +65,10 @@ public class BuildingServiceImpl implements BuildingService { private IcBuildingService icBuildingService; @Resource private IcBuildingDao icBuildingDao; - @Autowired private IcBuildingUnitService icBuildingUnitService; - @Resource private IcHouseDao icHouseDao; - @Autowired - private IcHouseService icHouseService; - @Resource private CustomerAgencyDao customerAgencyDao; @Resource @@ -76,8 +76,6 @@ public class BuildingServiceImpl implements BuildingService { @Resource private IcNeighborHoodDao icNeighborHoodDao; @Resource - private CustomerStaffAgencyDao customerStaffAgencyDao; - @Resource private IcBuildingUnitDao icBuildingUnitDao; @Autowired private IcHouseRedis icHouseRedis; @@ -112,7 +110,7 @@ public class BuildingServiceImpl implements BuildingService { icBuildingUnit.setUnitNum(String.valueOf(i+1)); unitList.add(icBuildingUnit); } - icBuildingUnitService.insertBatch(unitList); + icBuildingUnitService.insertBatch(unitList, NumConstant.ONE_HUNDRED); } @@ -428,12 +426,12 @@ public class BuildingServiceImpl implements BuildingService { * 3. 选中小区可导入该小区下所有楼宇信息、房屋信息(没有匹配的楼宇均新增); * 4. 选中楼宇可导入该楼宇下所有房屋信息。 * @param formDTO - * @param file + * @param inputStream * @author zxc * @date 2022/2/13 10:15 上午 */ @Override - public Result buildingImportExcel(ImportInfoFormDTO formDTO, InputStream inputStream,Result importTask) throws IOException { + public Result buildingImportExcel(ImportInfoFormDTO formDTO, InputStream inputStream,Result importTask) { executorService.submit(() -> { ExcelReader excelReader = null; try { diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index c99c6e03ac..9a560cb8f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -33,10 +33,8 @@ import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcHouseListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.NeighborHoodManageDelResultDTO; -import com.epmet.entity.IcHouseEntity; import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HouseTypeEnums; -import com.epmet.excel.IcHouseExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;