cjl
2023-10-07 f4e06be2e50d54a956ccd26c93661c4ab9d19bf6
ci:补充提交
5 files modified
35 ■■■■■ changed files
screen-manage/src/main/java/com/moral/api/entity/SysDictType.java 1 ●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/kafka/consumer/DeviceConsumer.java 13 ●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/mapper/SysDictTypeMapper.java 2 ●●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/service/impl/SysDictTypeServiceImpl.java 5 ●●●● patch | view | raw | blame | history
screen-manage/src/main/resources/mapper/SysDictTypeMapper.xml 14 ●●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/entity/SysDictType.java
@@ -46,6 +46,7 @@
    /*
    * 1:系统内置,无法更改 0:可以更改
    * */
    @TableField("`system`")
    private Integer system;
    /**
screen-manage/src/main/java/com/moral/api/kafka/consumer/DeviceConsumer.java
@@ -1,8 +1,9 @@
/*
package com.moral.api.kafka.consumer;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSON;
import com.moral.api.service.*;
import com.moral.constant.KafkaConstants;
import com.moral.constant.RedisConstants;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,16 +13,9 @@
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.moral.constant.KafkaConstants;
import com.moral.constant.RedisConstants;
@@ -224,4 +218,3 @@
        }
    }
}
*/
screen-manage/src/main/java/com/moral/api/mapper/SysDictTypeMapper.java
@@ -2,6 +2,7 @@
import com.moral.api.entity.SysDictType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
@@ -13,4 +14,5 @@
 */
public interface SysDictTypeMapper extends BaseMapper<SysDictType> {
    SysDictType listOne(@Param("name") String name);
}
screen-manage/src/main/java/com/moral/api/service/impl/SysDictTypeServiceImpl.java
@@ -124,10 +124,7 @@
        //获取要插入的实体
        SysDictType sysDictType = form.formConvertEntity();
        //判断name是否已经存在
        QueryWrapper<SysDictType> existNameWrapper = new QueryWrapper<>();
        existNameWrapper.eq("name",sysDictType.getName());
        existNameWrapper.eq("is_delete",Constants.NOT_DELETE);
        SysDictType existType = sysDictTypeMapper.selectOne(existNameWrapper);
        SysDictType existType = sysDictTypeMapper.listOne(sysDictType.getName());
        if(!ObjectUtils.isEmpty(existType)){
            dto.setCode(ResponseCodeEnum.DICTTYPE_EXIST.getCode());
            dto.setMsg(ResponseCodeEnum.DICTTYPE_EXIST.getMsg());
screen-manage/src/main/resources/mapper/SysDictTypeMapper.xml
@@ -12,4 +12,18 @@
                    <result column="is_delete" property="isDelete" />
        </resultMap>
    <select id="listOne" resultType="com.moral.api.entity.SysDictType">
        SELECT
            t.id,
            t.name,
            t.desc,
            t.system,
            t.create_time,
            t.update_time,
            t.is_delete
        FROM
            sys_dict_type t
        WHERE
            t.name =#{name}  AND is_delete = '0'
    </select>
</mapper>