zbj//
1.程序版本查询增加搜索框入参,使用实体接收参数 代码调整 2.终端运维管理终端流量使用详情接口 cld_dev_fuction表新增数据(test测试类删除)
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0.0
|
||||||
|
* @author: zbj
|
||||||
|
* @date: 2023/05/23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProgramParam extends BaseParam implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "devType", value = "装置系列,字典表", required = false)
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.influxdb.annotation.Column;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -20,16 +23,19 @@ public class DevFuction {
|
|||||||
/**
|
/**
|
||||||
* 装置功能Id
|
* 装置功能Id
|
||||||
*/
|
*/
|
||||||
|
@TableId("Id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置序号
|
* 装置序号
|
||||||
*/
|
*/
|
||||||
|
@TableField("Line_Id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能码,字典表
|
* 功能码,字典表
|
||||||
*/
|
*/
|
||||||
|
@TableField("Fuc_Name")
|
||||||
private String fucName;
|
private String fucName;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
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.pojo.vo.VersionVO;
|
||||||
import com.njcn.device.pq.service.ProgramVersionService;
|
import com.njcn.device.pq.service.ProgramVersionService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -41,9 +43,10 @@ public class ProgramVersionController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getProgramVersion")
|
@PostMapping("/getProgramVersion")
|
||||||
@ApiOperation("程序版本查询")
|
@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");
|
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);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,4 +19,7 @@ public interface DevFuctionMapper extends BaseMapper<DevFuction> {
|
|||||||
|
|
||||||
int addBatch(@Param("list") List<DevFuction> list);
|
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;
|
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.ShowVersionVO;
|
||||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -16,7 +17,7 @@ public interface ProgramVersionMapper {
|
|||||||
/**
|
/**
|
||||||
* 获取终端版本信息,根据装置型号查询
|
* 获取终端版本信息,根据装置型号查询
|
||||||
*/
|
*/
|
||||||
List<VersionVO> getVersion(String devType);
|
List<VersionVO> getVersion(ProgramParam programParam);
|
||||||
/**
|
/**
|
||||||
* 根据id获取终端版本信息
|
* 根据id获取终端版本信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -8,4 +8,16 @@
|
|||||||
(#{item.id},#{item.lineId},#{item.fucName})
|
(#{item.id},#{item.lineId},#{item.fucName})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
<if test="devType != null and devType != ''">
|
<if test="devType != null and devType != ''">
|
||||||
AND A.Dev_Type = #{devType}
|
AND A.Dev_Type = #{devType}
|
||||||
</if>
|
</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>
|
||||||
|
|
||||||
<select id="getProgramVersionById" resultType="ShowVersionVO">
|
<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;
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
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 com.njcn.device.pq.pojo.vo.VersionVO;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ public interface ProgramVersionService {
|
|||||||
* 根据终端类型分页获取程序版本管理信息
|
* 根据终端类型分页获取程序版本管理信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Page<VersionVO> getProgramVersion(String devType, Integer pageSize, Integer pageNum);
|
Page<VersionVO> getProgramVersion(ProgramParam programParam);
|
||||||
/**
|
/**
|
||||||
* 新增程序版本管理信息
|
* 新增程序版本管理信息
|
||||||
* @return
|
* @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.biz.enums.DeviceResponseEnum;
|
||||||
import com.njcn.device.pq.mapper.ProgramVersionMapper;
|
import com.njcn.device.pq.mapper.ProgramVersionMapper;
|
||||||
import com.njcn.device.pq.mapper.VersionMapper;
|
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.po.Version;
|
||||||
import com.njcn.device.pq.pojo.vo.ShowVersionVO;
|
import com.njcn.device.pq.pojo.vo.ShowVersionVO;
|
||||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||||
@@ -42,12 +43,12 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
|||||||
private final VersionMapper versionMapper;
|
private final VersionMapper versionMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<VersionVO> getProgramVersion(String devType, Integer pageSize, Integer pageNum) {
|
public Page<VersionVO> getProgramVersion(ProgramParam programParam) {
|
||||||
Page<VersionVO> page = new Page<>();
|
Page<VersionVO> page = new Page<>();
|
||||||
page.setSize(pageSize);
|
page.setSize(programParam.getPageSize());
|
||||||
page.setCurrent(pageNum);
|
page.setCurrent(programParam.getPageNum());
|
||||||
|
|
||||||
List<VersionVO> version = programVersionMapper.getVersion(devType);
|
List<VersionVO> version = programVersionMapper.getVersion(programParam);
|
||||||
if (!CollectionUtils.isEmpty(version)) {
|
if (!CollectionUtils.isEmpty(version)) {
|
||||||
for (VersionVO vo: version) {
|
for (VersionVO vo: version) {
|
||||||
if (vo.getVersionType().isEmpty()) {
|
if (vo.getVersionType().isEmpty()) {
|
||||||
@@ -57,10 +58,10 @@ public class ProgramVersionServiceImpl extends ServiceImpl<VersionMapper, Versio
|
|||||||
//待分页数据总量
|
//待分页数据总量
|
||||||
page.setTotal(version.size());
|
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);
|
page.setPages(pages);
|
||||||
List<List<VersionVO>> partition = Lists.partition(version, pageSize);
|
List<List<VersionVO>> partition = Lists.partition(version, programParam.getPageSize());
|
||||||
List<VersionVO> versionVOS = partition.get(pageNum - 1);
|
List<VersionVO> versionVOS = partition.get(programParam.getPageNum() - 1);
|
||||||
page.setRecords(versionVOS);
|
page.setRecords(versionVOS);
|
||||||
}
|
}
|
||||||
return page;
|
return page;
|
||||||
|
|||||||
Reference in New Issue
Block a user