bug调整

This commit is contained in:
xy
2025-01-03 13:13:28 +08:00
parent 04cdb50b13
commit f90a3228b9
3 changed files with 17 additions and 16 deletions

View File

@@ -33,13 +33,10 @@
</if>
<if test="csDevModelQueryParm.devName != null and csDevModelQueryParm.devName != ''">
AND a.dev_type_name LIKE concat('%',#{csDevModelQueryParm.devName},'%')
AND a.dev_type_name = #{csDevModelQueryParm.devName}
</if>
<!-- <if test="csDevModelQueryParm.devType != null and csDevModelQueryParm.devType != ''">-->
<!-- AND a.dev_type = #{csDevModelQueryParm.devType}-->
<!-- </if>-->
<if test="csDevModelQueryParm.name != null and csDevModelQueryParm.name != ''">
AND a.name = #{csDevModelQueryParm.name}
AND a.name LIKE concat('%',#{csDevModelQueryParm.name},'%')
</if>
order by a.version_date desc
</select>

View File

@@ -1,37 +1,32 @@
package com.njcn.csdevice.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.csdevice.mapper.CsDevModelMapper;
import com.njcn.csdevice.pojo.dto.CsDevModelDto;
import com.njcn.csdevice.pojo.param.CsDevModelAddParm;
import com.njcn.csdevice.pojo.param.CsDevModelAuditParm;
import com.njcn.csdevice.pojo.param.CsDevModelQueryListParm;
import com.njcn.csdevice.pojo.param.CsDevModelQueryParm;
import com.njcn.csdevice.pojo.po.CsDataArray;
import com.njcn.csdevice.pojo.po.CsDataSet;
import com.njcn.csdevice.pojo.po.CsDevModelPO;
import com.njcn.csdevice.pojo.vo.CsDevModelPageVO;
import com.njcn.csdevice.service.CsDevModelService;
import com.njcn.csdevice.service.ICsDataArrayService;
import com.njcn.csdevice.service.ICsDataSetService;
import com.njcn.redis.pojo.enums.AppRedisKey;
import com.njcn.redis.utils.RedisUtil;
import com.njcn.system.api.DictTreeFeignClient;
import com.njcn.system.pojo.po.SysDicTreePO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
*
@@ -50,6 +45,7 @@ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevMo
private final ICsDataSetService csDataSetService;
private final ICsDataArrayService csDataArrayService;
private final RedisUtil redisUtil;
private final DictTreeFeignClient dictTreeFeignClient;
@Override
public void refreshDevModelCache() {
@@ -128,7 +124,14 @@ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevMo
@Override
public IPage<CsDevModelPageVO> queryPage(CsDevModelQueryParm csDevModelQueryParm) {
Page<CsDevModelPageVO> returnpage = new Page<> (csDevModelQueryParm.getPageNum ( ), csDevModelQueryParm.getPageSize ( ));
if (Objects.nonNull (csDevModelQueryParm.getDevType()) && StringUtils.isNotBlank(csDevModelQueryParm.getDevType())) {
SysDicTreePO po = dictTreeFeignClient.queryById(csDevModelQueryParm.getDevType()).getData();
if (Objects.isNull (po)) {
throw new BusinessException("装置型号字典缺失");
} else {
csDevModelQueryParm.setDevName(po.getName());
}
}
returnpage = this.getBaseMapper ().getPage(returnpage,csDevModelQueryParm);
return returnpage;
}