Merge remote-tracking branch 'origin/upgrade' into upgrade
This commit is contained in:
commit
4edb4501ad
@ -9,6 +9,7 @@ import com.cm.common.result.SuccessResult;
|
||||
import com.cm.common.result.SuccessResultData;
|
||||
import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.population.pojo.dtos.building.BuildingDTO;
|
||||
import com.cm.population.pojo.vos.building.BuildingBatchVO;
|
||||
import com.cm.population.pojo.vos.building.BuildingVO;
|
||||
import com.cm.population.service.building.IBuildingService;
|
||||
import io.swagger.annotations.*;
|
||||
@ -108,4 +109,13 @@ public class BuildingController extends AbstractController {
|
||||
return new SuccessResultData<>(buildingService.count(params));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增楼排管理", notes = "新增楼排管理接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("saveBatch")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult saveBatch(@RequestBody BuildingBatchVO buildingBatchVO) {
|
||||
buildingService.saveBatch(buildingBatchVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
}
|
@ -9,6 +9,7 @@ import com.cm.common.result.SuccessResult;
|
||||
import com.cm.common.result.SuccessResultData;
|
||||
import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.population.pojo.dtos.building.BuildingDTO;
|
||||
import com.cm.population.pojo.vos.building.BuildingBatchVO;
|
||||
import com.cm.population.pojo.vos.building.BuildingVO;
|
||||
import com.cm.population.service.building.IBuildingService;
|
||||
import io.swagger.annotations.*;
|
||||
@ -120,4 +121,16 @@ public class BuildingAppController extends AbstractController {
|
||||
return new SuccessResultData<>(buildingService.count(params));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增楼排管理", notes = "新增楼排管理接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("saveBatch")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult saveBatch(@RequestHeader("token") String token, @RequestBody BuildingBatchVO buildingBatchVO) {
|
||||
buildingService.saveBatch(token, buildingBatchVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
}
|
@ -58,6 +58,14 @@ public class BuildingRouteController extends AbstractController {
|
||||
return new ModelAndView("building/list-myself");
|
||||
}
|
||||
|
||||
@GetMapping("save-batch")
|
||||
public ModelAndView saveBatch() {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
mv.setViewName("building/save-batch");
|
||||
setBaiduMapInit(mv);
|
||||
return mv;
|
||||
}
|
||||
|
||||
private void setBaiduMapInit(ModelAndView modelAndView) {
|
||||
String mapCenter = EnvManager.getInstance().getValue("MAP_CENTER");
|
||||
if (StringUtils.isBlank(mapCenter)) {
|
||||
|
@ -49,10 +49,4 @@ public class HouseRouteController extends AbstractController {
|
||||
public ModelAndView listMyself() {
|
||||
return new ModelAndView("house/list-myself");
|
||||
}
|
||||
|
||||
@GetMapping("save-batch")
|
||||
public ModelAndView saveBatch() {
|
||||
return new ModelAndView("house/save-batch");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,251 @@
|
||||
package com.cm.population.pojo.vos.building;
|
||||
|
||||
import com.cm.common.annotation.CheckNumberAnnotation;
|
||||
import com.cm.population.pojo.vos.house.HouseVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName: BuildingVO
|
||||
* @Description: 楼排管理
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2023-10-25 14:44:10
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class BuildingBatchVO {
|
||||
|
||||
public BuildingBatchVO() {
|
||||
}
|
||||
|
||||
@ApiModelProperty(name = "street", value = "街道ID")
|
||||
private String street;
|
||||
@ApiModelProperty(name = "streetName", value = "街道名称")
|
||||
private String streetName;
|
||||
@ApiModelProperty(name = "community", value = "所在社区")
|
||||
private String community;
|
||||
@ApiModelProperty(name = "communityName", value = "所在社区名称")
|
||||
private String communityName;
|
||||
@ApiModelProperty(name = "residentialId", value = "所在小区ID")
|
||||
private String residentialId;
|
||||
@ApiModelProperty(name = "residentialName", value = "所在小区名称")
|
||||
private String residentialName;
|
||||
@ApiModelProperty(name = "name", value = "楼排名称")
|
||||
private String name;
|
||||
@ApiModelProperty(name = "buildNum", value = "楼/排号")
|
||||
@CheckNumberAnnotation(name = "楼/排号")
|
||||
private Integer buildNum;
|
||||
@ApiModelProperty(name = "floorsNum", value = "楼层数")
|
||||
@CheckNumberAnnotation(name = "楼层数")
|
||||
private Integer floorsNum;
|
||||
@ApiModelProperty(name = "unitNum", value = "单元/排数")
|
||||
@CheckNumberAnnotation(name = "单元/排数")
|
||||
private Integer unitNum;
|
||||
@ApiModelProperty(name = "address", value = "详细地址")
|
||||
private String address;
|
||||
@ApiModelProperty(name = "longitude", value = "经度")
|
||||
private String longitude;
|
||||
@ApiModelProperty(name = "latitude", value = "纬度")
|
||||
private String latitude;
|
||||
@ApiModelProperty(name = "image", value = "图片")
|
||||
private String image;
|
||||
@ApiModelProperty(name = "resultList", value = "批量录入房屋信息")
|
||||
private List<BatchVO> resultList;
|
||||
|
||||
public String getCommunity() {
|
||||
return community == null ? "" : community.trim();
|
||||
}
|
||||
|
||||
public void setCommunity(String community) {
|
||||
this.community = community;
|
||||
}
|
||||
|
||||
public String getCommunityName() {
|
||||
return communityName == null ? "" : communityName.trim();
|
||||
}
|
||||
|
||||
public void setCommunityName(String communityName) {
|
||||
this.communityName = communityName;
|
||||
}
|
||||
|
||||
public String getResidentialId() {
|
||||
return residentialId == null ? "" : residentialId.trim();
|
||||
}
|
||||
|
||||
public void setResidentialId(String residentialId) {
|
||||
this.residentialId = residentialId;
|
||||
}
|
||||
|
||||
public String getResidentialName() {
|
||||
return residentialName == null ? "" : residentialName.trim();
|
||||
}
|
||||
|
||||
public void setResidentialName(String residentialName) {
|
||||
this.residentialName = residentialName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name == null ? "" : name.trim();
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getBuildNum() {
|
||||
return buildNum == null ? 0 : buildNum;
|
||||
}
|
||||
|
||||
public void setBuildNum(Integer buildNum) {
|
||||
this.buildNum = buildNum;
|
||||
}
|
||||
|
||||
public Integer getFloorsNum() {
|
||||
return floorsNum == null ? 0 : floorsNum;
|
||||
}
|
||||
|
||||
public void setFloorsNum(Integer floorsNum) {
|
||||
this.floorsNum = floorsNum;
|
||||
}
|
||||
|
||||
public Integer getUnitNum() {
|
||||
return unitNum;
|
||||
}
|
||||
|
||||
public void setUnitNum(Integer unitNum) {
|
||||
this.unitNum = unitNum;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address == null ? "" : address.trim();
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude == null ? "" : longitude.trim();
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude == null ? "" : latitude.trim();
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image == null ? "" : image.trim();
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet(String street) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getStreetName() {
|
||||
return streetName;
|
||||
}
|
||||
|
||||
public void setStreetName(String streetName) {
|
||||
this.streetName = streetName;
|
||||
}
|
||||
|
||||
public List<BatchVO> getResultList() {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public void setResultList(List<BatchVO> resultList) {
|
||||
this.resultList = resultList;
|
||||
}
|
||||
|
||||
public static class BatchVO {
|
||||
|
||||
public BatchVO() {
|
||||
}
|
||||
|
||||
@ApiModelProperty(name = "unitValue", value = "单元信息")
|
||||
private String unitValue;
|
||||
@ApiModelProperty(name = "floorList", value = "楼层信息")
|
||||
private List<FloorVO> floorList;
|
||||
|
||||
public String getUnitValue() {
|
||||
return unitValue;
|
||||
}
|
||||
|
||||
public void setUnitValue(String unitValue) {
|
||||
this.unitValue = unitValue;
|
||||
}
|
||||
|
||||
public List<FloorVO> getFloorList() {
|
||||
return floorList;
|
||||
}
|
||||
|
||||
public void setFloorList(List<FloorVO> floorList) {
|
||||
this.floorList = floorList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class FloorVO {
|
||||
|
||||
public FloorVO() {
|
||||
}
|
||||
|
||||
@ApiModelProperty(name = "floorValue", value = "单元信息")
|
||||
private String floorValue;
|
||||
@ApiModelProperty(name = "houseList", value = "房屋信息集合")
|
||||
private List<HouseVO> houseList;
|
||||
|
||||
public String getFloorValue() {
|
||||
return floorValue;
|
||||
}
|
||||
|
||||
public void setFloorValue(String floorValue) {
|
||||
this.floorValue = floorValue;
|
||||
}
|
||||
|
||||
public List<HouseVO> getHouseList() {
|
||||
return houseList;
|
||||
}
|
||||
|
||||
public void setHouseList(List<HouseVO> houseList) {
|
||||
this.houseList = houseList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class HouseVO {
|
||||
|
||||
public HouseVO() {
|
||||
}
|
||||
|
||||
@ApiModelProperty(name = "houseValue", value = "房屋信息")
|
||||
private String houseValue;
|
||||
|
||||
public String getHouseValue() {
|
||||
return houseValue;
|
||||
}
|
||||
|
||||
public void setHouseValue(String houseValue) {
|
||||
this.houseValue = houseValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,10 @@ public class HouseVO {
|
||||
private Integer affiliationUnit;
|
||||
@ApiModelProperty(name = "affiliationFloors", value = "所在层/院")
|
||||
@CheckNumberAnnotation(name = "所在层/院")
|
||||
private Integer affiliationFloors;
|
||||
private String affiliationFloors;
|
||||
@ApiModelProperty(name = "houseNum", value = "门牌号")
|
||||
@CheckNumberAnnotation(name = "门牌号")
|
||||
private Integer houseNum;
|
||||
private String houseNum;
|
||||
@ApiModelProperty(name = "categoryId", value = "房屋类别")
|
||||
private String categoryId;
|
||||
@ApiModelProperty(name = "categoryName", value = "房屋类别名称")
|
||||
@ -170,19 +170,19 @@ public class HouseVO {
|
||||
this.affiliationUnit = affiliationUnit;
|
||||
}
|
||||
|
||||
public Integer getAffiliationFloors() {
|
||||
return affiliationFloors == null ? 0 : affiliationFloors;
|
||||
public String getAffiliationFloors() {
|
||||
return affiliationFloors;
|
||||
}
|
||||
|
||||
public void setAffiliationFloors(Integer affiliationFloors) {
|
||||
public void setAffiliationFloors(String affiliationFloors) {
|
||||
this.affiliationFloors = affiliationFloors;
|
||||
}
|
||||
|
||||
public Integer getHouseNum() {
|
||||
return houseNum == null ? 0 : houseNum;
|
||||
public String getHouseNum() {
|
||||
return houseNum;
|
||||
}
|
||||
|
||||
public void setHouseNum(Integer houseNum) {
|
||||
public void setHouseNum(String houseNum) {
|
||||
this.houseNum = houseNum;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.population.pojo.bos.building.BuildingBO;
|
||||
import com.cm.population.pojo.dtos.building.BuildingDTO;
|
||||
import com.cm.population.pojo.pos.building.BuildingPO;
|
||||
import com.cm.population.pojo.vos.building.BuildingBatchVO;
|
||||
import com.cm.population.pojo.vos.building.BuildingVO;
|
||||
|
||||
import java.util.List;
|
||||
@ -185,4 +186,38 @@ public interface IBuildingService {
|
||||
*/
|
||||
Integer count(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 批量新增房屋信息
|
||||
*
|
||||
* @param buildingBatchVO
|
||||
* @return
|
||||
*/
|
||||
void saveBatch(BuildingBatchVO buildingBatchVO);
|
||||
|
||||
/**
|
||||
* 新增楼排管理
|
||||
*
|
||||
* @param token
|
||||
* @param buildingBatchVO
|
||||
* @return
|
||||
*/
|
||||
void saveBatch(String token, BuildingBatchVO buildingBatchVO);
|
||||
|
||||
/**
|
||||
* 新增楼排管理
|
||||
*
|
||||
* @param buildingBatchVO
|
||||
* @return buildingId
|
||||
*/
|
||||
String saveBatchReturnId(BuildingBatchVO buildingBatchVO);
|
||||
|
||||
/**
|
||||
* 新增楼排管理
|
||||
*
|
||||
* @param token
|
||||
* @param buildingBatchVO
|
||||
* @return buildingId
|
||||
*/
|
||||
String saveBatchReturnId(String token, BuildingBatchVO buildingBatchVO);
|
||||
|
||||
}
|
@ -13,8 +13,11 @@ import com.cm.population.pojo.bos.building.BuildingBO;
|
||||
import com.cm.population.pojo.dtos.building.BuildingDTO;
|
||||
import com.cm.population.pojo.dtos.residential.ResidentialDTO;
|
||||
import com.cm.population.pojo.pos.building.BuildingPO;
|
||||
import com.cm.population.pojo.vos.building.BuildingBatchVO;
|
||||
import com.cm.population.pojo.vos.building.BuildingVO;
|
||||
import com.cm.population.pojo.vos.house.HouseVO;
|
||||
import com.cm.population.service.building.IBuildingService;
|
||||
import com.cm.population.service.house.IHouseService;
|
||||
import com.cm.population.service.residential.IResidentialService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@ -38,6 +41,8 @@ public class BuildingServiceImpl extends AbstractService implements IBuildingSer
|
||||
private IBuildingDao buildingDao;
|
||||
@Autowired
|
||||
private IResidentialService residentialService;
|
||||
@Autowired
|
||||
private IHouseService houseService;
|
||||
|
||||
@Override
|
||||
public void save(BuildingVO buildingVO) {
|
||||
@ -157,14 +162,14 @@ public class BuildingServiceImpl extends AbstractService implements IBuildingSer
|
||||
|
||||
@Override
|
||||
public List<BuildingDTO> list(Map<String, Object> params) {
|
||||
if(null != params.get("myself")) {
|
||||
if (null != params.get("myself")) {
|
||||
UserInfoBO userInfoBO = this.securityComponent.getCurrentUser();
|
||||
params.put("creator", userInfoBO.getUserId());
|
||||
}
|
||||
List<BuildingDTO> list = buildingDao.list(params);
|
||||
for (BuildingDTO buildingDTO : list) {
|
||||
ResidentialDTO residentialDTO = residentialService.get(buildingDTO.getResidentialId());
|
||||
if(null != residentialDTO) {
|
||||
if (null != residentialDTO) {
|
||||
buildingDTO.setResidentialName(residentialDTO.getName());
|
||||
}
|
||||
}
|
||||
@ -195,4 +200,62 @@ public class BuildingServiceImpl extends AbstractService implements IBuildingSer
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(BuildingBatchVO buildingBatchVO) {
|
||||
saveBatchReturnId(buildingBatchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(String token, BuildingBatchVO buildingBatchVO) {
|
||||
saveBatchReturnId(token, buildingBatchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveBatchReturnId(BuildingBatchVO buildingBatchVO) {
|
||||
return saveBatchReturnId(null, buildingBatchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveBatchReturnId(String token, BuildingBatchVO buildingBatchVO) {
|
||||
String buildingId = UUIDUtil.getUUID();
|
||||
Map<String, Object> params = null;
|
||||
try {
|
||||
params = HashMapUtil.beanToMap(buildingBatchVO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
params.put("buildingId", buildingId);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
setSaveInfo(params);
|
||||
} else {
|
||||
setSaveInfo(token, params);
|
||||
}
|
||||
buildingDao.save(params);
|
||||
|
||||
List<BuildingBatchVO.BatchVO> resultList = buildingBatchVO.getResultList();
|
||||
if (null != resultList && resultList.size() > 0) {
|
||||
for (BuildingBatchVO.BatchVO batchVO : resultList) {
|
||||
for (BuildingBatchVO.FloorVO floorVO : batchVO.getFloorList()) {
|
||||
for (BuildingBatchVO.HouseVO houseVO : floorVO.getHouseList()) {
|
||||
HouseVO insertHouseVO = new HouseVO();
|
||||
// 基本信息
|
||||
insertHouseVO.setResidentialId(buildingBatchVO.getResidentialId());
|
||||
insertHouseVO.setResidentialName(buildingBatchVO.getResidentialName());
|
||||
insertHouseVO.setStreet(buildingBatchVO.getStreet());
|
||||
insertHouseVO.setStreetName(buildingBatchVO.getStreetName());
|
||||
insertHouseVO.setCommunity(buildingBatchVO.getCommunity());
|
||||
insertHouseVO.setCommunityName(buildingBatchVO.getCommunityName());
|
||||
|
||||
insertHouseVO.setBuildingId(buildingId);
|
||||
insertHouseVO.setAffiliatedUnit(batchVO.getUnitValue());
|
||||
insertHouseVO.setAffiliationFloors(floorVO.getFloorValue());
|
||||
insertHouseVO.setHouseNum(houseVO.getHouseValue());
|
||||
houseService.save(insertHouseVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return buildingId;
|
||||
}
|
||||
|
||||
}
|
@ -327,6 +327,9 @@
|
||||
<if test="residentialId != null and residentialId != ''">
|
||||
AND t1.residential_id = #{residentialId}
|
||||
</if>
|
||||
<if test="residentialName != null and residentialName != ''">
|
||||
AND t1.residential_name = #{residentialName}
|
||||
</if>
|
||||
<if test="street != null and street != ''">
|
||||
AND t1.street = #{street}
|
||||
</if>
|
||||
|
@ -94,7 +94,7 @@
|
||||
<div class="layui-col-xs4">
|
||||
<label class="layui-form-label">门牌号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="houseNum" name="houseNum" class="layui-input" value="" placeholder="请输入门牌号" lay-verify="required">
|
||||
<input type="text" id="houseNum" name="houseNum" class="layui-input" value="" placeholder="请输入门牌号" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -94,7 +94,7 @@
|
||||
<div class="layui-col-xs4">
|
||||
<label class="layui-form-label">门牌号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="houseNum" name="houseNum" class="layui-input" value="" placeholder="请输入门牌号" lay-verify="required">
|
||||
<input type="text" id="houseNum" name="houseNum" class="layui-input" value="" placeholder="请输入门牌号" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user