cqm
This commit is contained in:
parent
0965ba1b2d
commit
912332c1bf
|
|
@ -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<List<CqmPersionResultVO>> getDeviceTypeCqm(@RequestParam("id") Long id){
|
||||
TBaseDeviceType deviceType = baseDeviceTypeService.getBaseMapper().selectById(id);
|
||||
VUtils.trueThrow(deviceType==null).throwMessage(STATE.ParamErr,"设备类型不存在");
|
||||
List<CqmPersionResultVO> result= Collections.emptyList();
|
||||
if(StrUtil.isNotBlank(deviceType.getCqmPersonId())){
|
||||
List<String> userIds = StrUtil.split(deviceType.getCqmPersonId(), ",");
|
||||
|
||||
result = baseDeviceTypeService.getDeviceTypeCqmList(Convert.toList(Integer.class, userIds));
|
||||
}
|
||||
return ApiResult.success(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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<TBaseDeviceType> {
|
|||
List<CqmPersonVO> getCqmPersonList(@Param("cqms") List<String> cqms);
|
||||
|
||||
String getCqmsByDeviceType(String deviceNo);
|
||||
|
||||
List<CqmPersionResultVO> getDeviceTypeCqmList(@Param("ids") List<Integer> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<TBaseDeviceType> {
|
|||
List<CqmPersonVO> getCqmPersonList(@Param("cqms") List<String> cqms);
|
||||
|
||||
List<Integer> getCqmsByDeviceType(String deviceNo);
|
||||
|
||||
List<CqmPersionResultVO> getDeviceTypeCqmList(@Param("ids") List<Integer> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<TBaseDeviceTypeMappe
|
|||
}
|
||||
return StrUtil.split(cqms, ",").stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<CqmPersionResultVO> getDeviceTypeCqmList(@Param("ids") List<Integer> ids){
|
||||
return this.getBaseMapper().getDeviceTypeCqmList(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceTypeCqmList" resultType="com.nflg.mobilebroken.common.pojo.vo.CqmPersionResultVO">
|
||||
select a.id,a.user_code, a.user_name,a.department_id,b.dept_code,b.dept_name from admin_user a
|
||||
join t_base_department b on a.department_id=b.id
|
||||
where a.di in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue