parent
122f8ac4d3
commit
1c6fb64a91
|
@ -203,8 +203,11 @@ public class TenCellController extends AbstractController {
|
||||||
@ApiOperation("删除小区")
|
@ApiOperation("删除小区")
|
||||||
@RequiresPermissions("ten:cell")
|
@RequiresPermissions("ten:cell")
|
||||||
//@RequiresPermissions("ten:cell:delete")
|
//@RequiresPermissions("ten:cell:delete")
|
||||||
public R syncRoomAddress(@RequestParam("cellId") Long cellId){
|
public R syncRoomAddress(@RequestParam("cellId") Long cellId,@RequestParam("layerFlag") Integer layerFlag){
|
||||||
int count = tenRoomService.syncAddress(cellId);
|
if(layerFlag ==null){
|
||||||
|
layerFlag = 0;
|
||||||
|
}
|
||||||
|
int count = tenRoomService.syncAddress(cellId,layerFlag);
|
||||||
return R.ok().put("count",count);
|
return R.ok().put("count",count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public interface TenCellService extends IService<TenCellEntity> {
|
||||||
|
|
||||||
void updateByIdResis(TenCellEntity cell);
|
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);
|
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
|
@Override
|
||||||
public int syncRoomAddress(Long cellId) {
|
public int syncRoomAddress(Long cellId,Integer layerFlag) {
|
||||||
return tenRoomService.syncAddress(cellId);
|
return tenRoomService.syncAddress(cellId,layerFlag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,7 @@ public class TenRoomServiceImpl implements TenRoomService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int syncAddress(Long cellId) {
|
public int syncAddress(Long cellId,Integer layerFlag) {
|
||||||
List<TenRoomEntity> allRooms = tenRoomDao.getNotBindByCellId(cellId);
|
List<TenRoomEntity> allRooms = tenRoomDao.getNotBindByCellId(cellId);
|
||||||
TenCellEntity cellEntity = tenCellService.getById(cellId);
|
TenCellEntity cellEntity = tenCellService.getById(cellId);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -217,12 +217,23 @@ public class TenRoomServiceImpl implements TenRoomService {
|
||||||
String unit = buildEntity.getUnit();
|
String unit = buildEntity.getUnit();
|
||||||
String layer = roomEntity.getLayer().toString();
|
String layer = roomEntity.getLayer().toString();
|
||||||
String roomNumber = roomEntity.getRoomNumber().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<>();
|
||||||
.eq("dzjb",14)
|
if(layerFlag.intValue() == 0){
|
||||||
.eq("xqid",xqid)
|
String address = "号"+buildNumber+"栋"+unit+"单元"+layer+"层"+roomNumber+"号";
|
||||||
.like("dzqc",address));
|
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){
|
if(searchAddressList.size() == 1){
|
||||||
TenAddressEntity addressEntity = searchAddressList.get(0);
|
TenAddressEntity addressEntity = searchAddressList.get(0);
|
||||||
|
|
Loading…
Reference in New Issue