fix:设备-维护保养、使用记录微调

This commit is contained in:
FCL
2026-03-09 11:20:39 +08:00
parent b5ef91613b
commit 2247f6df5f
12 changed files with 94 additions and 110 deletions

View File

@@ -1,10 +1,7 @@
package com.zt.plat.module.qms.resource.device.controller.admin; package com.zt.plat.module.qms.resource.device.controller.admin;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO; import com.zt.plat.module.qms.resource.device.controller.vo.*;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainRespVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainSaveReqVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO;
import com.zt.plat.module.qms.resource.device.service.DeviceInfomationService; import com.zt.plat.module.qms.resource.device.service.DeviceInfomationService;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -98,8 +95,8 @@ public class DeviceMaintainController extends AbstractFileUploadController imple
@GetMapping("/queryPageListWithCount") @GetMapping("/queryPageListWithCount")
@Operation(summary = "维护-分页列表查询(以设备为主数据)") @Operation(summary = "维护-分页列表查询(以设备为主数据)")
public CommonResult<PageResult<DeviceMaintainVO>> queryPageListWithCount(@Valid DeviceMaintainPageReqVO pageReqVO) { public CommonResult<PageResult<DeviceInfomationMaintainVO>> queryPageListWithCount(@Valid DeviceMaintainPageReqVO pageReqVO) {
PageResult<DeviceMaintainVO> pageResult = deviceMaintainService.queryPageListWithCount(pageReqVO); PageResult<DeviceInfomationMaintainVO> pageResult = deviceMaintainService.queryPageListWithCount(pageReqVO);
return success(pageResult); return success(pageResult);
} }

View File

@@ -63,8 +63,8 @@ public class DeviceUseRecordController extends AbstractFileUploadController impl
@GetMapping("/queryPageListWithCount") @GetMapping("/queryPageListWithCount")
@Operation(summary = "使用记录分页列表查询(以设备为主数据)") @Operation(summary = "使用记录分页列表查询(以设备为主数据)")
public CommonResult<PageResult<DeviceInfomationWithProductVO>> queryPageListWithCount(@Valid DeviceUseRecordPageReqVO pageReqVO) { public CommonResult<PageResult<DeviceInfomationUseRecordVO>> queryPageListWithCount(@Valid DeviceUseRecordPageReqVO pageReqVO) {
PageResult<DeviceInfomationWithProductVO> pageResult = deviceUseRecordService.queryPageListWithCount(pageReqVO); PageResult<DeviceInfomationUseRecordVO> pageResult = deviceUseRecordService.queryPageListWithCount(pageReqVO);
return success(pageResult); return success(pageResult);
} }

View File

@@ -0,0 +1,25 @@
package com.zt.plat.module.qms.resource.device.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/*
* 设备含维护记录数
* */
@Data
public class DeviceInfomationMaintainVO extends DeviceInfomationWithProductVO {
//============使用记录数============
@Schema(description = "未提交数据量")
private Integer runningCount;
@Schema(description = "已提交数据量")
private Integer finishedCount;
//============查询字段============
@Schema(description = "截止时间不为空")
private String useTimeEndFlag;
}

View File

@@ -43,28 +43,12 @@ public class DeviceMaintainVO extends DeviceMaintainRespVO {
@Schema(description = "所属部门名称") @Schema(description = "所属部门名称")
private String deptName; private String deptName;
@Schema(description = "维修状态: 1-维修0-正常") @Schema(description = "设备状态")
private Integer repairFlag; private String deviceStatus;
@Schema(description = "降级状态")
private Integer demoteFlag;
@Schema(description = "报废状态")
private Integer scrapFlag;
@Schema(description = "停用状态")
private Integer disableFlag;
@Schema(description = "外借状态")
private Integer lendFlag;
@Schema(description = "使用中状态") @Schema(description = "使用中状态")
private Integer inUseFlag; private Integer inUseFlag;
@Schema(description = "验收状态")
private String acceptFlag;
//============维护信息字段============ //============维护信息字段============
@Schema(description = "维护项目列表") @Schema(description = "维护项目列表")
List<DeviceMaintainItemDO> maintainItemList; List<DeviceMaintainItemDO> maintainItemList;

View File

@@ -5,9 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO; import com.zt.plat.module.qms.resource.device.controller.vo.*;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@@ -40,7 +39,9 @@ public interface DeviceMaintainMapper extends BaseMapperX<DeviceMaintainDO> {
.orderByDesc(DeviceMaintainDO::getId)); .orderByDesc(DeviceMaintainDO::getId));
} }
IPage<DeviceMaintainVO> queryPageListWithCount(Page<DeviceMaintainVO> page, @Param("param") DeviceMaintainPageReqVO param); // IPage<DeviceMaintainVO> queryPageListWithCount(Page<DeviceMaintainVO> page, @Param("param") DeviceMaintainPageReqVO param);
DeviceMaintainVO queryVoById(@Param("id") Long id); // DeviceMaintainVO queryVoById(@Param("id") Long id);
IPage<DeviceInfomationMaintainVO> queryPageListWithCount(Page<DeviceInfomationMaintainVO> page, @Param("param") DeviceMaintainPageReqVO param);
} }

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationUseRecordVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationWithProductVO; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationWithProductVO;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceUseRecordPageReqVO; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceUseRecordPageReqVO;
@@ -45,7 +46,7 @@ public interface DeviceUseRecordMapper extends BaseMapperX<DeviceUseRecordDO> {
return selectPage(reqVO, query); return selectPage(reqVO, query);
} }
IPage<DeviceInfomationWithProductVO> queryPageListWithCount(Page<DeviceInfomationWithProductVO> page, @Param("param") DeviceUseRecordPageReqVO param); IPage<DeviceInfomationUseRecordVO> queryPageListWithCount(Page<DeviceInfomationUseRecordVO> page, @Param("param") DeviceUseRecordPageReqVO param);
// DeviceUseRecordVO queryVoById(@Param("id") Long id); // DeviceUseRecordVO queryVoById(@Param("id") Long id);

View File

@@ -60,6 +60,8 @@ public class DeviceConfigBusinessRuleServiceImpl implements DeviceConfigBusiness
if(!ObjectUtils.isEmpty(path)){ if(!ObjectUtils.isEmpty(path)){
String[] split = path.split("/"); String[] split = path.split("/");
for (String s : split) { for (String s : split) {
if(ObjectUtils.isEmpty(s))
continue;
String id = s.replaceAll("/", ""); String id = s.replaceAll("/", "");
if(id.equals("0")) if(id.equals("0"))
continue; continue;

View File

@@ -5,10 +5,7 @@ import java.time.LocalDate;
import java.util.*; import java.util.*;
import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO; import com.zt.plat.module.qms.resource.device.controller.vo.*;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainRespVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainSaveReqVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO;
import jakarta.validation.*; import jakarta.validation.*;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
@@ -26,7 +23,7 @@ public interface DeviceMaintainService {
CommonResult<DeviceMaintainVO> create(Long deviceId, LocalDate lastDate, String dataType); CommonResult<DeviceMaintainVO> create(Long deviceId, LocalDate lastDate, String dataType);
PageResult<DeviceMaintainVO> queryPageListWithCount(DeviceMaintainPageReqVO pageReqVO); PageResult<DeviceInfomationMaintainVO> queryPageListWithCount(DeviceMaintainPageReqVO pageReqVO);
CommonResult<DeviceMaintainVO> getMaintainDetail(Long id); CommonResult<DeviceMaintainVO> getMaintainDetail(Long id);

View File

@@ -9,10 +9,7 @@ import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.LoginUser;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.module.qms.resource.device.common.DeviceUtil; import com.zt.plat.module.qms.resource.device.common.DeviceUtil;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO; import com.zt.plat.module.qms.resource.device.controller.vo.*;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainRespVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainSaveReqVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainItemDO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainItemDO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -131,9 +128,11 @@ public class DeviceMaintainServiceImpl implements DeviceMaintainService {
@Override @Override
public CommonResult<DeviceMaintainVO> getMaintainDetail(Long id) { public CommonResult<DeviceMaintainVO> getMaintainDetail(Long id) {
DeviceMaintainVO vo = deviceMaintainMapper.queryVoById( id); DeviceMaintainDO entity = deviceMaintainMapper.selectById( id);
if(vo == null) if(entity == null)
throw exception(DEVICE_MAINTAIN_NOT_EXISTS); throw exception(DEVICE_MAINTAIN_NOT_EXISTS);
DeviceMaintainVO vo = new DeviceMaintainVO();
BeanUtils.copyProperties(entity, vo);
List<DeviceMaintainItemDO> itemList = deviceMaintainItemService.getListByParId( id); List<DeviceMaintainItemDO> itemList = deviceMaintainItemService.getListByParId( id);
vo.setMaintainItemList(itemList); vo.setMaintainItemList(itemList);
return CommonResult.success( vo); return CommonResult.success( vo);
@@ -155,7 +154,7 @@ public class DeviceMaintainServiceImpl implements DeviceMaintainService {
} }
@Override @Override
public PageResult<DeviceMaintainVO> queryPageListWithCount(DeviceMaintainPageReqVO reqVO) { public PageResult<DeviceInfomationMaintainVO> queryPageListWithCount(DeviceMaintainPageReqVO reqVO) {
Long productId = reqVO.getProductId(); Long productId = reqVO.getProductId();
if(productId != null){ if(productId != null){
List<Long> productIds = deviceProductService.getIdListByIdPath(productId); List<Long> productIds = deviceProductService.getIdListByIdPath(productId);
@@ -165,9 +164,9 @@ public class DeviceMaintainServiceImpl implements DeviceMaintainService {
reqVO.setDeviceIdList(deviceIds); reqVO.setDeviceIdList(deviceIds);
} }
} }
Page<DeviceMaintainVO> page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize()); Page<DeviceInfomationMaintainVO> page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize());
IPage<DeviceMaintainVO> pageList = deviceMaintainMapper.queryPageListWithCount(page, reqVO); IPage<DeviceInfomationMaintainVO> pageList = deviceMaintainMapper.queryPageListWithCount(page, reqVO);
return new PageResult<>(pageList.getRecords(), pageList.getTotal()); return new PageResult<>(pageList.getRecords(), pageList.getTotal());
} }

View File

@@ -16,7 +16,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
public interface DeviceUseRecordService { public interface DeviceUseRecordService {
PageResult<DeviceInfomationWithProductVO> queryPageListWithCount(DeviceUseRecordPageReqVO reqVO); PageResult<DeviceInfomationUseRecordVO> queryPageListWithCount(DeviceUseRecordPageReqVO reqVO);
/** /**
* 创建设备-使用记录 * 创建设备-使用记录

Some files were not shown because too many files have changed in this diff Show More