Merge branch 'zjw'

This commit is contained in:
zhangjunwen 2024-10-29 17:51:56 +08:00
commit 89d3b3e516
18 changed files with 209 additions and 32 deletions

View File

@ -5,6 +5,7 @@ import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO;
import com.inspur.module.system.controller.baseData.vo.ModelInfoSelectionVO;
import com.inspur.module.system.controller.equip.vo.*;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.service.baseData.CustomerInfoService;
import com.inspur.module.system.service.baseData.ModelInfoService;
import com.inspur.module.system.service.equip.EquipDashboardService;
@ -85,7 +86,7 @@ public class EquipInfoController {
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('imt:equip-info:query')")
public CommonResult<EquipInfoRespVO> getEquipInfo(@RequestParam("id") String id) {
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(id);
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(id);//
return success(BeanUtils.toBean(equipInfo, EquipInfoRespVO.class));
}

View File

@ -0,0 +1,82 @@
package com.inspur.module.system.dal.dataobject.equip;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.util.Date;
/**
* @Author zhangjunwen
* @create 2024/10/29
*/
@Data
public class EquipInfoDetailsDTO {
/**
* 机床信息id
*/
@TableId(type = IdType.ASSIGN_UUID)
private String equipId;
/**
* 机床型号id
*/
private String modelId;
/**
* 客户信息id
*/
private String customerId;
/**
* 机床设备名称
*/
private String equipName;
/**
* 机床设备编号
*/
private String equipNo;
/**
* 生产日期
*/
private Date productDate;
/**
* 出厂日期/购买日期
*/
private Date purchaseDate;
/**
* 保修到期日期
*/
private Date expireDate;
/**
* 机床状态
*
*/
private Integer status;
/**
* 机床运行状态
*/
private Integer runStatus;
/**
* 二维码图片路径
*/
private String qrcodePicPath;
/**
* 备注
*/
private String remark;
/**
* 租户
*/
private Long tenantId;
/**
* 客户名称
*/
private String customerName;
/**
* 机床型号
*/
private String modelName;
}

View File

@ -1,15 +1,16 @@
package com.inspur.module.system.dal.mysql.equip;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.inspur.framework.common.pojo.PageResult;
import com.inspur.framework.common.util.object.BeanUtils;
import com.inspur.framework.mybatis.core.mapper.BaseMapperX;
import com.inspur.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.inspur.module.system.controller.baseData.vo.ModelInfoSelectionVO;
import com.inspur.framework.mybatis.core.query.MPJLambdaWrapperX;
import com.inspur.module.system.controller.equip.vo.EquipInfoPageReqVO;
import com.inspur.module.system.controller.equip.vo.EquipSelectionVO;
import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO;
import com.inspur.module.system.dal.dataobject.baseData.ModelInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -35,4 +36,15 @@ public interface EquipInfoMapper extends BaseMapperX<EquipInfoDO> {
List<EquipInfoDO> equipInfoList = selectList();
return BeanUtils.toBean(equipInfoList, EquipSelectionVO.class);
}
default EquipInfoDetailsDTO selectEquipInfoDetailsListById(String equipId) {
return selectJoinOne(EquipInfoDetailsDTO.class,new MPJLambdaWrapperX<EquipInfoDO>()
.selectAll(EquipInfoDO.class)
.selectAs(ModelInfoDO::getModelName, EquipInfoDetailsDTO::getModelName)
.selectAs(CustomerInfoDO::getCustomerName, EquipInfoDetailsDTO::getCustomerName)
.leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId)
.leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId)
.eq(EquipInfoDO::getEquipId,equipId)
);
}
}

View File

@ -8,6 +8,7 @@ import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.dal.dataobject.alarm.AlarmDataDTO;
import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.service.equip.EquipInfoService;
import com.inspur.module.system.service.inspection.InspectionInfoServiceImpl;
import org.springframework.stereotype.Service;
@ -53,7 +54,7 @@ public class AlarmDataServiceImpl implements AlarmDataService {
// 插入
AlarmDataDO alarmData = BeanUtils.toBean(createReqVO, AlarmDataDO.class);
if(Objects.nonNull(alarmData.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(alarmData.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(alarmData.getEquipId());
Optional<Long> tenantIdOptional = Optional.ofNullable(equipInfo.getTenantId());
tenantIdOptional.ifPresent(alarmData::setTenantId);
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDTO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.service.equip.EquipInfoService;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@ -49,7 +50,7 @@ public class AlarmRulesServiceImpl implements AlarmRulesService {
AlarmRulesDO alarmRules = BeanUtils.toBean(createReqVO, AlarmRulesDO.class);
alarmRules.setStatus(0);//默认开启
if(Objects.nonNull(alarmRules.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(alarmRules.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(alarmRules.getEquipId());
Optional<Long> tenantIdOptional = Optional.ofNullable(equipInfo.getTenantId());
tenantIdOptional.ifPresent(alarmRules::setTenantId);
}

View File

@ -9,6 +9,7 @@ import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO;
import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDTO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
import com.inspur.module.system.service.equip.EquipInfoService;
@ -55,7 +56,7 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService {
// 插入
EquipAlarmDataDO equipAlarmData = BeanUtils.toBean(createReqVO, EquipAlarmDataDO.class);
if(Objects.nonNull(equipAlarmData.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(equipAlarmData.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(equipAlarmData.getEquipId());
Optional<Long> tenantIdOptional = Optional.ofNullable(equipInfo.getTenantId());
tenantIdOptional.ifPresent(equipAlarmData::setTenantId);
}

View File

@ -8,6 +8,7 @@ import com.inspur.module.system.controller.equip.vo.ComponentInfoSaveReqVO;
import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO;
import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.dal.mysql.equip.ComponentInfoMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -43,7 +44,7 @@ public class ComponentInfoServiceImpl implements ComponentInfoService {
ComponentInfoDO componentInfo = BeanUtils.toBean(createReqVO, ComponentInfoDO.class);
//如果机床id不为空进行租户传递
if (StrUtil.isNotBlank(componentInfo.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(componentInfo.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(componentInfo.getEquipId());
if (Objects.nonNull(equipInfo)){
componentInfo.setTenantId(equipInfo.getTenantId());
}
@ -62,7 +63,7 @@ public class ComponentInfoServiceImpl implements ComponentInfoService {
ComponentInfoDO updateObj = BeanUtils.toBean(updateReqVO, ComponentInfoDO.class);
//如果机床id不为空进行租户传递
if (StrUtil.isNotBlank(updateObj.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(updateObj.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(updateObj.getEquipId());
if (Objects.nonNull(equipInfo)){
updateObj.setTenantId(equipInfo.getTenantId());
}

View File

@ -3,6 +3,7 @@ package com.inspur.module.system.service.equip;
import com.inspur.framework.common.pojo.PageResult;
import com.inspur.module.system.controller.equip.vo.*;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import javax.validation.*;
import java.util.List;
@ -42,7 +43,7 @@ public interface EquipInfoService {
* @param id 编号
* @return 机床信息
*/
EquipInfoDO getEquipInfo(String id);
EquipInfoDetailsDTO getEquipInfo(String id);
/**
* 获得机床信息分页

View File

@ -11,6 +11,7 @@ import com.inspur.module.system.controller.equip.vo.*;
import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO;
import com.inspur.module.system.dal.dataobject.baseData.ModelInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.mysql.equip.EquipInfoMapper;
import com.inspur.module.system.enums.ErrorCodeConstants;
@ -99,8 +100,8 @@ public class EquipInfoServiceImpl implements EquipInfoService {
}
@Override
public EquipInfoDO getEquipInfo(String id) {
return equipInfoMapper.selectById(id);
public EquipInfoDetailsDTO getEquipInfo(String id) {
return equipInfoMapper.selectEquipInfoDetailsListById(id);
}
@Override

View File

@ -2,6 +2,7 @@ package com.inspur.module.system.service.gatewayinfo;
import com.inspur.framework.common.util.string.StrUtils;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayCardParamsDO;
import com.inspur.module.system.dal.mysql.gatewayinfo.GatewayCardParamsMapper;
import com.inspur.module.system.service.equip.EquipInfoService;
@ -48,7 +49,7 @@ public class GatewayCardInfoServiceImpl implements GatewayCardInfoService {
// 插入
GatewayCardInfoDO gatewayCardInfo = BeanUtils.toBean(createReqVO, GatewayCardInfoDO.class);
if(Objects.nonNull(gatewayCardInfo.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(gatewayCardInfo.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(gatewayCardInfo.getEquipId());
Optional<Long> tenantIdOptional = Optional.ofNullable(equipInfo.getTenantId());
tenantIdOptional.ifPresent(gatewayCardInfo::setTenantId);
}

View File

@ -1,6 +1,7 @@
package com.inspur.module.system.service.gatewayinfo;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.service.equip.EquipInfoService;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@ -46,7 +47,7 @@ public class GatewayCardParamsServiceImpl implements GatewayCardParamsService {
// 插入
GatewayCardParamsDO gatewayCardParams = BeanUtils.toBean(createReqVO, GatewayCardParamsDO.class);
if(Objects.nonNull(gatewayCardParams.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(gatewayCardParams.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(gatewayCardParams.getEquipId());
Optional<Long> tenantIdOptional = Optional.ofNullable(equipInfo.getTenantId());
tenantIdOptional.ifPresent(gatewayCardParams::setTenantId);
}
@ -70,7 +71,7 @@ public class GatewayCardParamsServiceImpl implements GatewayCardParamsService {
}
List<GatewayCardParamsDO> gatewayCardParamsList = BeanUtils.toBean(paramsList, GatewayCardParamsDO.class);
if(Objects.nonNull(equipId)){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(equipId);
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(equipId);
Optional<Long> tenantIdOptional = Optional.ofNullable(equipInfo.getTenantId());
gatewayCardParamsList = gatewayCardParamsList.stream().peek(cardParamInfo -> tenantIdOptional.ifPresent(cardParamInfo::setTenantId)).collect(Collectors.toList());
}

View File

@ -3,6 +3,7 @@ package com.inspur.module.system.service.gatewayinfo;
import com.inspur.framework.common.util.json.JsonUtils;
import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayCardInfoDO;
import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayCardParamsDO;
import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayInfoDetailsDTO;
@ -70,7 +71,7 @@ public class GatewayInfoServiceImpl implements GatewayInfoService {
// 插入
GatewayInfoDO gatewayInfo = BeanUtils.toBean(createReqVO, GatewayInfoDO.class);
if(Objects.nonNull(gatewayInfo.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(gatewayInfo.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(gatewayInfo.getEquipId());
Optional<Long> tenantIdOptional = Optional.ofNullable(equipInfo.getTenantId());
tenantIdOptional.ifPresent(gatewayInfo::setTenantId);
}

View File

@ -19,6 +19,7 @@ import com.inspur.module.system.controller.inspection.vo.InspectionInfoSaveReqVO
import com.inspur.module.system.controller.maintenance.vo.*;
import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO;
import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
import com.inspur.module.system.dal.dataobject.inspection.InspectionInfoDO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceReportDO;
@ -111,7 +112,7 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
}
//如果设备id不是空进行租户传递
if (StrUtil.isNotBlank(remoteMaintenanceOrder.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(remoteMaintenanceOrder.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(remoteMaintenanceOrder.getEquipId());
if (Objects.nonNull(equipInfo)){
remoteMaintenanceOrder.setTenantId(equipInfo.getTenantId());
}
@ -158,7 +159,7 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
MaintenanceOrderDO updateObj = BeanUtils.toBean(updateReqVO, MaintenanceOrderDO.class);
//如果设备id不是空进行租户传递
if (StrUtil.isNotBlank(updateObj.getEquipId())){
EquipInfoDO equipInfo = equipInfoService.getEquipInfo(updateObj.getEquipId());
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(updateObj.getEquipId());
if (Objects.nonNull(equipInfo)){
updateObj.setTenantId(equipInfo.getTenantId());
}

View File

@ -26,6 +26,7 @@
:show-node-num="showNodeNum"
:key="getNodeKey(child)"
:props="props"
:isClickInput="isClickInput"
></OkrTreeNode>
</div>
</div>
@ -103,6 +104,10 @@ export default {
type: Array,
},
filterNodeMethod: Function,
isClickInput: {
type: Boolean,
default: false,
},
props: {
default() {
return {
@ -159,6 +164,7 @@ export default {
direction: this.direction,
animate: this.animate,
animateName: this.animateName,
isClickInput: this.isClickInput,
});
this.root = this.store.root;
this.okrEventBus.$on("inputCompleted", this.handleInputCompleted);

View File

@ -142,6 +142,7 @@
:key="getNodeKey(child)"
:show-node-num="showNodeNum"
:props="props"
:isClickInput="isClickInput"
></OkrTreeNode>
</div>
</transition>
@ -217,6 +218,11 @@ export default {
selectedKey: String,
//
nodeKey: String,
//
isClickInput: {
type: Boolean,
default: false,
},
},
components: {
NodeContent: {
@ -508,7 +514,7 @@ export default {
const store = this.tree.store;
store.setCurrentNode(this.node);
this.tree.$emit("node-click", this.node.data, this.node, this);
if (this.node.isLeaf && this.node.childNodes) {
if (this.node.isLeaf && this.node.childNodes && this.isClickInput) {
this.toggleInput();
} //
},

View File

@ -5,6 +5,16 @@
style="border-bottom:1px solid black"
>
<div class="head-info">
<div
class="info"
style="margin-right:2px"
>
<span class="title">设备名称</span>
<span
class="content"
style="color:yellowgreen"
>{{ equipName }}</span>
</div>
<div
class="info"
style="margin-right:2px"
@ -32,16 +42,6 @@
style="color:yellowgreen"
>{{ equipNo }}</span>
</div>
<div
class="info"
style="margin-right:2px"
>
<span class="title">报警等级</span>
<span class="content"><dict-tag
:type="DICT_TYPE.ALARM_LEVEL"
:value="alarmLevel"
/></span>
</div>
</div>
</div>
<div class="select">
@ -273,9 +273,10 @@ export default {
name: "EquipInfo",
data() {
return {
customerName: "济南机床厂",
modelName: "MK15806",
equipNo: "37089765",
equipName: "",
customerName: "",
modelName: "",
equipNo: "",
alarmLevel: 1,
datetimeRange: this.getDefaultTimeRange(),
loading1: false,
@ -336,7 +337,9 @@ export default {
};
},
created() {
this.getParamsTree("2e3d0190e63eda526da89d6c751f08f3");
this.queryParams.equipId = this.$route.query.equipId;
this.getParamsTree(this.$route.query.equipId);
this.getEquipInfo(this.$route.query.equipId);
},
methods: {
/** 查询列表 */
@ -369,6 +372,15 @@ export default {
} finally {
}
},
async getEquipInfo(equipId) {
const res = await EquipInfoApi.getEquipInfo(equipId);
const data = res.data;
console.log("设备信息:", res);
this.customerName = data.customerName;
this.modelName = data.modelName;
this.equipNo = data.equipNo;
this.equipName = data.equipName;
},
async getParamsTree(equipId) {
const cardTree = await getGatewayCardTree(equipId);
var treeData = [];

View File

@ -25,6 +25,22 @@
<span class="name">设备编号</span>
<span class="prop">{{ item.equipNo }}</span>
</div>
<div class="title-button">
<el-button
size="mini"
type="text"
icon="el-icon-receiving"
@click="handleDetails(item)"
>设备详情
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-data-line"
@click="handleToDataDash(item)"
>监控数据看板
</el-button>
</div>
</div>
<div class="content">
<div class="equ-content">
@ -201,6 +217,32 @@ export default {
return "dashboard";
}
},
handleToDataDash(item) {
if (item.equipId) {
this.$router.push({
path: "/equip/datadashboard",
query: { equipId: item.equipId },
});
} else {
this.$message({
message: "设备" + item.equipName + "不存在,无法跳转详情",
type: "warning",
});
}
},
handleDetails(item) {
if (item.equipId) {
this.$router.push({
path: "/equip/equipdetails",
query: { equipId: item.equipId },
});
} else {
this.$message({
message: "设备" + item.equipName + "不存在,无法跳转详情",
type: "warning",
});
}
},
},
};
</script>
@ -222,6 +264,8 @@ export default {
.title {
display: flex;
justify-content: space-around;
cursor: pointer;
align-items: center;
}
/* .equ-info {
} */
@ -259,4 +303,7 @@ export default {
font-size: 20px;
font-weight: 700;
}
.title-button {
display: grid;
}
</style>

View File

@ -45,6 +45,7 @@
:props="props"
show-collapsable
default-expand-all
:isClickInput="true"
:current-lable-class-name="renderCurrentClass"
@node-click="nodeClick"
@comment-submitted="handleCommentSubmitted"