parent
122f8ac4d3
commit
1c6fb64a91
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface TenCellService extends IService<TenCellEntity> {
|
|||
|
||||
void updateByIdResis(TenCellEntity cell);
|
||||
|
||||
int syncRoomAddress(Long cellId);
|
||||
int syncRoomAddress(Long cellId,Integer layerFlag);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,6 @@ public interface TenRoomService {
|
|||
|
||||
List<TenRoomEntity> getNotSync(Long paramLong);
|
||||
|
||||
int syncAddress(Long cellId);
|
||||
int syncAddress(Long cellId,Integer layerFlag);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>()
|
||||
.eq("dzjb",14)
|
||||
.eq("xqid",xqid)
|
||||
.like("dzqc",address));
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue