车间能级提升-智能设备管理系统
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsEquServiceImpl.java
@@ -46,8 +46,16 @@
     * @return 【设备台账】
     */
    @Override
    public EimsEquVo queryById(Long equId){
    public EimsEquVo queryById(Long equId) {
        return baseMapper.selectVoById(equId);
    }
    @Override
    public EimsEquVo queryByAssetNo(String assetNo) {
        LambdaQueryWrapper<EimsEqu> lqw = new LambdaQueryWrapper<>();
        lqw.eq(EimsEqu::getAssetNo, assetNo.trim());
        EimsEquVo eimsEquVo = baseMapper.selectVoOne(lqw);
        return eimsEquVo;
    }
    /**
@@ -87,7 +95,15 @@
         */
        if (equTypeId != null && equTypeId > 0) {
            List<Long> allDescendantIds = getAllDescendantIds(equTypeId);
            lqw.in(EimsEqu::getEquTypeId,allDescendantIds);
            lqw.in(EimsEqu::getEquTypeId, allDescendantIds);
        }
        if (params.get("searchValue") != null && StringUtils.isNotBlank(params.get("searchValue").toString())) {
            // 如果搜索值不为空,则按设备名称、资产编号进行模糊查询
            lqw.and(wrapper -> {
                wrapper.like(EimsEqu::getEquName, params.get("searchValue"))
                    .or()
                    .like(EimsEqu::getAssetNo, params.get("searchValue"));
            });
        }
        lqw.like(StringUtils.isNotBlank(bo.getEquName()), EimsEqu::getEquName, bo.getEquName());
@@ -112,11 +128,14 @@
        lqw.eq(bo.getServiceLife() != null, EimsEqu::getServiceLife, bo.getServiceLife());
        lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
            EimsEqu::getDeployDate, params.get("beginTime"), params.get("endTime"));
        // 按创建日期倒序
        lqw.orderByDesc(EimsEqu::getCreateTime);
        return lqw;
    }
    /**
     * 根据id,获取所有后代id
     *
     * @param rootId
     * @return
     */
@@ -140,6 +159,7 @@
            }
        }
    }
    /**
     * 新增【设备台账】
     *
@@ -173,7 +193,7 @@
    /**
     * 保存前的数据校验
     */
    private void validEntityBeforeSave(EimsEqu entity){
    private void validEntityBeforeSave(EimsEqu entity) {
        //TODO 做一些数据校验,如唯一约束
    }
@@ -186,7 +206,7 @@
     */
    @Override
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
        if(isValid){
        if (isValid) {
            //TODO 做一些业务上的校验,判断是否需要校验
        }
        return baseMapper.deleteByIds(ids) > 0;