Commit 506eec8d authored by 刘凡's avatar 刘凡

优化:查询设备是否正在使用,使用中的设备不显示删除按钮

parent c700060d
......@@ -10,7 +10,11 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.jg.biz.service.*;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
......@@ -134,6 +138,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired
private SuperviseInfoMapper superviseInfoMapper;
@Autowired
private JgInstallationNoticeEqServiceImpl jgInstallationNoticeEqServiceImpl;
@Autowired
private JgUseRegistrationEqServiceImpl jgUseRegistrationEqServiceImpl;
/**
* 设备注册信息
......@@ -1062,6 +1072,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String status = ConstructionEnum.getName.get(integer);
dto2.put(CONSTRUCTIONTYPE, status);
}
//查询设备是否正在使用
//设备的使用标识是,安装告知和使用登记中有使用记录。
String equId = (String) dto2.get("SEQUENCE_NBR");
List<JgInstallationNoticeEq> installationNoticeEqList = jgInstallationNoticeEqServiceImpl.getListByEquId(equId);
List<JgUseRegistrationEq> useRegistrationEqList = jgUseRegistrationEqServiceImpl.getListByEquId(equId);
if(!ValidationUtil.isEmpty(installationNoticeEqList) || !ValidationUtil.isEmpty(useRegistrationEqList)){
dto2.put("IS_USE", true);
}else {
dto2.put("IS_USE", false);
}
list.add(dto2);
}
totle = response.getInternalResponse().hits().getTotalHits().value;
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeEqService;
......@@ -30,4 +31,11 @@ public class JgInstallationNoticeEqServiceImpl extends BaseService<JgInstallatio
public List<JgInstallationNoticeEqDto> queryForJgInstallationNoticeEqList() {
return this.queryForList("" , false);
}
public List<JgInstallationNoticeEq> getListByEquId(String equId) {
QueryWrapper<JgInstallationNoticeEq> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(JgInstallationNoticeEq::getEquId,equId);
queryWrapper.lambda().eq(JgInstallationNoticeEq::getIsDelete,false);
return list(queryWrapper);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationEqService;
......@@ -30,4 +31,13 @@ public class JgUseRegistrationEqServiceImpl extends BaseService<JgUseRegistratio
public List<JgUseRegistrationEqDto> queryForJgUseRegistrationEqList() {
return this.queryForList("" , false);
}
public List<JgUseRegistrationEq> getListByEquId(String equId) {
QueryWrapper<JgUseRegistrationEq> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(JgUseRegistrationEq::getEquId,equId);
queryWrapper.lambda().eq(JgUseRegistrationEq::getIsDelete,false);
return list(queryWrapper);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment