diff --git a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceTypeController.java b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceTypeController.java index 3df42a65..d0db9545 100644 --- a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceTypeController.java +++ b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceTypeController.java @@ -13,6 +13,7 @@ import com.nflg.mobilebroken.common.constant.STATE; import com.nflg.mobilebroken.common.exception.NflgException; import com.nflg.mobilebroken.common.pojo.ApiResult; import com.nflg.mobilebroken.common.pojo.PageData; +import com.nflg.mobilebroken.common.pojo.vo.CqmPersionResultVO; import com.nflg.mobilebroken.common.pojo.vo.CqmPersonVO; import com.nflg.mobilebroken.common.util.AdminUserUtil; import com.nflg.mobilebroken.common.util.VUtils; @@ -21,14 +22,12 @@ import com.nflg.mobilebroken.repository.entity.TBaseDeviceType; import com.nflg.mobilebroken.repository.service.IParamConfigService; import com.nflg.mobilebroken.repository.service.ITBaseDeviceTypeService; import com.nflg.mobilebroken.starter.annotation.MethodInfoMark; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; import java.time.LocalDateTime; +import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -117,4 +116,23 @@ public class DeviceTypeController extends ControllerBase { return ApiResult.success(baseDeviceTypeService.removeBatchByIds(ids)); } + + /** + * 获取设备类型-CQM人员 + * @return + */ + @GetMapping("getDeviceTypeCqm") + @ApiMark(moduleName = "设备类型管理", apiName = "取设备类型-CQM人员") + public ApiResult> getDeviceTypeCqm(@RequestParam("id") Long id){ + TBaseDeviceType deviceType = baseDeviceTypeService.getBaseMapper().selectById(id); + VUtils.trueThrow(deviceType==null).throwMessage(STATE.ParamErr,"设备类型不存在"); + List result= Collections.emptyList(); + if(StrUtil.isNotBlank(deviceType.getCqmPersonId())){ + List userIds = StrUtil.split(deviceType.getCqmPersonId(), ","); + + result = baseDeviceTypeService.getDeviceTypeCqmList(Convert.toList(Integer.class, userIds)); + } + return ApiResult.success(result); + } + } diff --git a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/CqmPersionResultVO.java b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/CqmPersionResultVO.java new file mode 100644 index 00000000..d5729fca --- /dev/null +++ b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/CqmPersionResultVO.java @@ -0,0 +1,40 @@ +package com.nflg.mobilebroken.common.pojo.vo; + + +import lombok.Data; + +@Data +public class CqmPersionResultVO { + + /** + * 用户ID + */ + private Integer id; + + /** + * 用户编码 + */ + private String userCode; + + + /** + * 用户名称 + */ + private String userName; + + /** + * 部门ID + */ + private Long departmentId; + + /** + * 部门编码 + */ + private String deptCode; + + + /** + * 部门名称 + */ + private String deptName; +} diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/mapper/TBaseDeviceTypeMapper.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/mapper/TBaseDeviceTypeMapper.java index 24bdd0c5..8ecc7dd4 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/mapper/TBaseDeviceTypeMapper.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/mapper/TBaseDeviceTypeMapper.java @@ -3,6 +3,7 @@ package com.nflg.mobilebroken.repository.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery; +import com.nflg.mobilebroken.common.pojo.vo.CqmPersionResultVO; import com.nflg.mobilebroken.common.pojo.vo.CqmPersonVO; import com.nflg.mobilebroken.repository.entity.TBaseDeviceType; import org.apache.ibatis.annotations.Param; @@ -26,4 +27,6 @@ public interface TBaseDeviceTypeMapper extends BaseMapper { List getCqmPersonList(@Param("cqms") List cqms); String getCqmsByDeviceType(String deviceNo); + + List getDeviceTypeCqmList(@Param("ids") List ids); } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/ITBaseDeviceTypeService.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/ITBaseDeviceTypeService.java index 632a0f8b..8a6ad52e 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/ITBaseDeviceTypeService.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/ITBaseDeviceTypeService.java @@ -3,6 +3,7 @@ package com.nflg.mobilebroken.repository.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery; +import com.nflg.mobilebroken.common.pojo.vo.CqmPersionResultVO; import com.nflg.mobilebroken.common.pojo.vo.CqmPersonVO; import com.nflg.mobilebroken.repository.entity.TBaseDeviceType; import org.apache.ibatis.annotations.Param; @@ -27,4 +28,6 @@ public interface ITBaseDeviceTypeService extends IService { List getCqmPersonList(@Param("cqms") List cqms); List getCqmsByDeviceType(String deviceNo); + + List getDeviceTypeCqmList(@Param("ids") List ids); } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TBaseDeviceTypeServiceImpl.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TBaseDeviceTypeServiceImpl.java index e5e987af..069e0997 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TBaseDeviceTypeServiceImpl.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TBaseDeviceTypeServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery; +import com.nflg.mobilebroken.common.pojo.vo.CqmPersionResultVO; import com.nflg.mobilebroken.common.pojo.vo.CqmPersonVO; import com.nflg.mobilebroken.repository.entity.TBaseDeviceType; import com.nflg.mobilebroken.repository.mapper.TBaseDeviceTypeMapper; @@ -47,4 +48,8 @@ public class TBaseDeviceTypeServiceImpl extends ServiceImpl getDeviceTypeCqmList(@Param("ids") List ids){ + return this.getBaseMapper().getDeviceTypeCqmList(ids); + } } diff --git a/nflg-mobilebroken-repository/src/main/resources/mapper/TBaseDeviceTypeMapper.xml b/nflg-mobilebroken-repository/src/main/resources/mapper/TBaseDeviceTypeMapper.xml index a553d76e..e6c8cb4b 100644 --- a/nflg-mobilebroken-repository/src/main/resources/mapper/TBaseDeviceTypeMapper.xml +++ b/nflg-mobilebroken-repository/src/main/resources/mapper/TBaseDeviceTypeMapper.xml @@ -37,4 +37,13 @@ INNER JOIN t_base_device_type dt ON d.device_type=dt.device_type WHERE dt.device_state=1 AND d.device_no=#{deviceNo} + +