zbj//
1.程序版本查询增加搜索框入参,使用实体接收参数 代码调整 2.终端运维管理终端流量使用详情接口 cld_dev_fuction表新增数据(test测试类删除)
This commit is contained in:
@@ -7,6 +7,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
import com.njcn.device.pq.service.ProgramVersionService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -41,9 +43,10 @@ public class ProgramVersionController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getProgramVersion")
|
||||
@ApiOperation("程序版本查询")
|
||||
public HttpResult<Page<VersionVO>> getProgramVersion(@RequestParam(value = "devType",required = false) String devType,@RequestParam("pageSize") Integer pageSize,@RequestParam("pageNum") Integer pageNum) {
|
||||
@ApiImplicitParam(name = "programParam", value = "程序版本查询", required = true)
|
||||
public HttpResult<Page<VersionVO>> getProgramVersion(@RequestBody @Validated ProgramParam programParam) {
|
||||
String methodDescribe = getMethodDescribe("getProgramVersion");
|
||||
Page<VersionVO> list = programService.getProgramVersion(devType, pageSize, pageNum);
|
||||
Page<VersionVO> list = programService.getProgramVersion(programParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
@@ -19,4 +19,7 @@ public interface DevFuctionMapper extends BaseMapper<DevFuction> {
|
||||
|
||||
int addBatch(@Param("list") List<DevFuction> list);
|
||||
|
||||
//查询pq_line表等级为5的装置去device表查装置id与装置功能存入cld_dev_fuction表
|
||||
List<DevFuction> selectLineTable();
|
||||
List<DevFuction> selectDictTable();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.vo.ShowVersionVO;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -16,7 +17,7 @@ public interface ProgramVersionMapper {
|
||||
/**
|
||||
* 获取终端版本信息,根据装置型号查询
|
||||
*/
|
||||
List<VersionVO> getVersion(String devType);
|
||||
List<VersionVO> getVersion(ProgramParam programParam);
|
||||
/**
|
||||
* 根据id获取终端版本信息
|
||||
*/
|
||||
|
||||
@@ -8,4 +8,16 @@
|
||||
(#{item.id},#{item.lineId},#{item.fucName})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--查询pq_line表等级为5的装置去device表查装置id与装置功能存入cld_dev_fuction表-->
|
||||
<select id="selectLineTable" resultType="com.njcn.device.pq.pojo.po.DevFuction">
|
||||
SELECT pd.id "lineId" FROM pq_device pd
|
||||
inner join pq_line pl on pd.id = pl.id
|
||||
where pl.`Level` = 4
|
||||
</select>
|
||||
<select id="selectDictTable" resultType="com.njcn.device.pq.pojo.po.DevFuction">
|
||||
select sdd.id "fucName" from sys_dict_type sdt
|
||||
inner join sys_dict_data sdd on sdd.Type_Id = sdt.Id
|
||||
where sdt.`Code` = 'Dev_Fun'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
<if test="devType != null and devType != ''">
|
||||
AND A.Dev_Type = #{devType}
|
||||
</if>
|
||||
<if test="searchValue != null and searchValue != ''">
|
||||
AND (A.`Name` like concat('%',#{searchValue},'%') or A.`Protocol` like concat('%',#{searchValue},'%') or A.`Remark` like concat('%',#{searchValue},'%'))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getProgramVersionById" resultType="ShowVersionVO">
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.po.DevFuction;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 终端异常统计业务层
|
||||
* @author zbj
|
||||
* @date 2023/05/24
|
||||
*/
|
||||
@Service
|
||||
public interface DevFuctionService extends IService<DevFuction> {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -17,7 +18,7 @@ public interface ProgramVersionService {
|
||||
* 根据终端类型分页获取程序版本管理信息
|
||||
* @return
|
||||
*/
|
||||
Page<VersionVO> getProgramVersion(String devType, Integer pageSize, Integer pageNum);
|
||||
Page<VersionVO> getProgramVersion(ProgramParam programParam);
|
||||
/**
|
||||
* 新增程序版本管理信息
|
||||
* @return
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.DevFuctionMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevFuction;
|
||||
import com.njcn.device.pq.service.DevFuctionService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zbj
|
||||
* @date 2022/05/24
|
||||
*/
|
||||
@Service
|
||||
public class DevFuctionServiceImpl extends ServiceImpl<DevFuctionMapper, DevFuction> implements DevFuctionService {
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.ProgramVersionMapper;
|
||||
import com.njcn.device.pq.mapper.VersionMapper;
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.po.Version;
|
||||
import com.njcn.device.pq.pojo.vo.ShowVersionVO;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
@@ -42,12 +43,12 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
||||
private final VersionMapper versionMapper;
|
||||
|
||||
@Override
|
||||
public Page<VersionVO> getProgramVersion(String devType, Integer pageSize, Integer pageNum) {
|
||||
public Page<VersionVO> getProgramVersion(ProgramParam programParam) {
|
||||
Page<VersionVO> page = new Page<>();
|
||||
page.setSize(pageSize);
|
||||
page.setCurrent(pageNum);
|
||||
page.setSize(programParam.getPageSize());
|
||||
page.setCurrent(programParam.getPageNum());
|
||||
|
||||
List<VersionVO> version = programVersionMapper.getVersion(devType);
|
||||
List<VersionVO> version = programVersionMapper.getVersion(programParam);
|
||||
if (!CollectionUtils.isEmpty(version)) {
|
||||
for (VersionVO vo: version) {
|
||||
if (vo.getVersionType().isEmpty()) {
|
||||
@@ -57,10 +58,10 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
||||
//待分页数据总量
|
||||
page.setTotal(version.size());
|
||||
//分页总页数
|
||||
int pages = (int)Math.ceil(version.size()*1.0/pageSize);
|
||||
int pages = (int)Math.ceil(version.size()*1.0/programParam.getPageSize());
|
||||
page.setPages(pages);
|
||||
List<List<VersionVO>> partition = Lists.partition(version, pageSize);
|
||||
List<VersionVO> versionVOS = partition.get(pageNum - 1);
|
||||
List<List<VersionVO>> partition = Lists.partition(version, programParam.getPageSize());
|
||||
List<VersionVO> versionVOS = partition.get(programParam.getPageNum() - 1);
|
||||
page.setRecords(versionVOS);
|
||||
}
|
||||
return page;
|
||||
|
||||
Reference in New Issue
Block a user