refactor: 优化设备类型服务实现并增强日志
This commit is contained in:
parent
cc53fb1b68
commit
de13d0881f
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.common.pojo.request;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
|
@ -28,6 +29,13 @@ public class TicketCallHangUpRequest {
|
|||
@NotNull
|
||||
private Integer fromUserId;
|
||||
|
||||
public Integer getFromUserId() {
|
||||
if (fromUserId < 2000000) {
|
||||
return fromUserId;
|
||||
}
|
||||
return Integer.valueOf(StrUtil.removePrefix(String.valueOf(fromUserId).substring(1), "0"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否拒绝接听
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,9 +9,11 @@ import com.nflg.mobilebroken.common.pojo.vo.CqmPersonVO;
|
|||
import com.nflg.mobilebroken.repository.entity.TBaseDeviceType;
|
||||
import com.nflg.mobilebroken.repository.mapper.TBaseDeviceTypeMapper;
|
||||
import com.nflg.mobilebroken.repository.service.ITBaseDeviceTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -19,37 +21,38 @@ import java.util.stream.Collectors;
|
|||
* <p>
|
||||
* 设备类型 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 曹鹏飞
|
||||
* @since 2025-01-24
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class TBaseDeviceTypeServiceImpl extends ServiceImpl<TBaseDeviceTypeMapper, TBaseDeviceType> implements ITBaseDeviceTypeService {
|
||||
|
||||
@Override
|
||||
public Page<TBaseDeviceType> getList(Page<PageBaseQuery> page, PageBaseQuery query) {
|
||||
return this.getBaseMapper().getList(page, query);
|
||||
return this.getBaseMapper().getList(page, query);
|
||||
}
|
||||
|
||||
public List<String> getDistinctDeviceType(){
|
||||
public List<String> getDistinctDeviceType() {
|
||||
return this.getBaseMapper().getDistinctDeviceType();
|
||||
}
|
||||
|
||||
|
||||
public List<CqmPersonVO> getCqmPersonList(@Param("cqms") List<String> cqms){
|
||||
public List<CqmPersonVO> getCqmPersonList(@Param("cqms") List<String> cqms) {
|
||||
return this.getBaseMapper().getCqmPersonList(cqms);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getCqmsByDeviceType(String deviceNo) {
|
||||
String cqms=this.getBaseMapper().getCqmsByDeviceType(deviceNo);
|
||||
if (StrUtil.isBlank(cqms)){
|
||||
return null;
|
||||
String cqms = this.getBaseMapper().getCqmsByDeviceType(deviceNo);
|
||||
if (StrUtil.isBlank(cqms)) {
|
||||
log.warn("设备{}未设置CQM", deviceNo);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return StrUtil.split(cqms, ",").stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<CqmPersionResultVO> getDeviceTypeCqmList(@Param("ids") List<Integer> ids){
|
||||
public List<CqmPersionResultVO> getDeviceTypeCqmList(@Param("ids") List<Integer> ids) {
|
||||
return this.getBaseMapper().getDeviceTypeCqmList(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue