1.户室同步优化,增加带楼层的房屋号
This commit is contained in:
gaoben 2021-08-13 16:08:09 +08:00
parent 122f8ac4d3
commit 1c6fb64a91
5 changed files with 26 additions and 12 deletions

View File

@ -203,8 +203,11 @@ public class TenCellController extends AbstractController {
@ApiOperation("删除小区")
@RequiresPermissions("ten:cell")
//@RequiresPermissions("ten:cell:delete")
public R syncRoomAddress(@RequestParam("cellId") Long cellId){
int count = tenRoomService.syncAddress(cellId);
public R syncRoomAddress(@RequestParam("cellId") Long cellId,@RequestParam("layerFlag") Integer layerFlag){
if(layerFlag ==null){
layerFlag = 0;
}
int count = tenRoomService.syncAddress(cellId,layerFlag);
return R.ok().put("count",count);
}
}

View File

@ -30,7 +30,7 @@ public interface TenCellService extends IService<TenCellEntity> {
void updateByIdResis(TenCellEntity cell);
int syncRoomAddress(Long cellId);
int syncRoomAddress(Long cellId,Integer layerFlag);
}

View File

@ -49,6 +49,6 @@ public interface TenRoomService {
List<TenRoomEntity> getNotSync(Long paramLong);
int syncAddress(Long cellId);
int syncAddress(Long cellId,Integer layerFlag);
}

View File

@ -181,7 +181,7 @@ public class TenCellServiceImpl extends ServiceImpl<TenCellDao, TenCellEntity> i
}
@Override
public int syncRoomAddress(Long cellId) {
return tenRoomService.syncAddress(cellId);
public int syncRoomAddress(Long cellId,Integer layerFlag) {
return tenRoomService.syncAddress(cellId,layerFlag);
}
}

View File

@ -205,7 +205,7 @@ public class TenRoomServiceImpl implements TenRoomService {
@Override
@Transactional(rollbackFor = Exception.class)
public int syncAddress(Long cellId) {
public int syncAddress(Long cellId,Integer layerFlag) {
List<TenRoomEntity> allRooms = tenRoomDao.getNotBindByCellId(cellId);
TenCellEntity cellEntity = tenCellService.getById(cellId);
int count = 0;
@ -217,12 +217,23 @@ public class TenRoomServiceImpl implements TenRoomService {
String unit = buildEntity.getUnit();
String layer = roomEntity.getLayer().toString();
String roomNumber = roomEntity.getRoomNumber().toString();
String address = ""+buildNumber+""+unit+"单元"+layer+""+roomNumber+"";
//查询可以关联的标准地址
List<TenAddressEntity> searchAddressList = tenAddressService.list(new QueryWrapper<TenAddressEntity>()
List<TenAddressEntity> searchAddressList = new ArrayList<>();
if(layerFlag.intValue() == 0){
String address = ""+buildNumber+""+unit+"单元"+layer+""+roomNumber+"";
searchAddressList = tenAddressService.list(new QueryWrapper<TenAddressEntity>()
.eq("dzjb",14)
.eq("xqid",xqid)
.like("dzqc",address));
}
if(layerFlag.intValue() == 1){
String address = ""+buildNumber+""+unit+"单元"+layer+""+layer+"0?"+roomNumber+"";
searchAddressList = tenAddressService.list(new QueryWrapper<TenAddressEntity>()
.eq("dzjb",14)
.eq("xqid",xqid)
.last("and dzqc REGEXP '"+address+"'"));
}
//查询关联的是否已经绑定
if(searchAddressList.size() == 1){
TenAddressEntity addressEntity = searchAddressList.get(0);