bug调整
This commit is contained in:
@@ -47,7 +47,8 @@ public class CsDevModelQueryParm {
|
|||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private String versionEndDate;
|
private String versionEndDate;
|
||||||
|
@ApiModelProperty(value = "装置型号")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,10 @@
|
|||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="csDevModelQueryParm.devName != null and csDevModelQueryParm.devName != ''">
|
<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>
|
||||||
<!-- <if test="csDevModelQueryParm.devType != null and csDevModelQueryParm.devType != ''">-->
|
|
||||||
<!-- AND a.dev_type = #{csDevModelQueryParm.devType}-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<if test="csDevModelQueryParm.name != null and csDevModelQueryParm.name != ''">
|
<if test="csDevModelQueryParm.name != null and csDevModelQueryParm.name != ''">
|
||||||
AND a.name = #{csDevModelQueryParm.name}
|
AND a.name LIKE concat('%',#{csDevModelQueryParm.name},'%')
|
||||||
</if>
|
</if>
|
||||||
order by a.version_date desc
|
order by a.version_date desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -1,37 +1,32 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
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.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.mapper.CsDevModelMapper;
|
||||||
import com.njcn.csdevice.pojo.dto.CsDevModelDto;
|
|
||||||
import com.njcn.csdevice.pojo.param.CsDevModelAddParm;
|
import com.njcn.csdevice.pojo.param.CsDevModelAddParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsDevModelAuditParm;
|
import com.njcn.csdevice.pojo.param.CsDevModelAuditParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsDevModelQueryListParm;
|
import com.njcn.csdevice.pojo.param.CsDevModelQueryListParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsDevModelQueryParm;
|
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.po.CsDevModelPO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsDevModelPageVO;
|
import com.njcn.csdevice.pojo.vo.CsDevModelPageVO;
|
||||||
import com.njcn.csdevice.service.CsDevModelService;
|
import com.njcn.csdevice.service.CsDevModelService;
|
||||||
import com.njcn.csdevice.service.ICsDataArrayService;
|
import com.njcn.csdevice.service.ICsDataArrayService;
|
||||||
import com.njcn.csdevice.service.ICsDataSetService;
|
import com.njcn.csdevice.service.ICsDataSetService;
|
||||||
import com.njcn.redis.pojo.enums.AppRedisKey;
|
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
|
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
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 ICsDataSetService csDataSetService;
|
||||||
private final ICsDataArrayService csDataArrayService;
|
private final ICsDataArrayService csDataArrayService;
|
||||||
private final RedisUtil redisUtil;
|
private final RedisUtil redisUtil;
|
||||||
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refreshDevModelCache() {
|
public void refreshDevModelCache() {
|
||||||
@@ -128,7 +124,14 @@ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevMo
|
|||||||
@Override
|
@Override
|
||||||
public IPage<CsDevModelPageVO> queryPage(CsDevModelQueryParm csDevModelQueryParm) {
|
public IPage<CsDevModelPageVO> queryPage(CsDevModelQueryParm csDevModelQueryParm) {
|
||||||
Page<CsDevModelPageVO> returnpage = new Page<> (csDevModelQueryParm.getPageNum ( ), csDevModelQueryParm.getPageSize ( ));
|
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);
|
returnpage = this.getBaseMapper ().getPage(returnpage,csDevModelQueryParm);
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user