feat:大屏配置
This commit is contained in:
1 parent
8a08aa79e6
commit
85c58c8303
9 files changed
+244
No files matched your search
@@ -0,0 +1,15 @@
|
||||
-- 大屏配置表
|
||||
CREATE TABLE `hard_panel_setting`
|
||||
(
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID',
|
||||
`nutrition_top_exclude_classify` varchar(1024) NOT NULL COMMENT '营养分析-菜品排行-排除菜品分类',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '是否删除(0=正常 1=删除)',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='大屏配置表';
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.panel;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.panel.HardPanelSettingEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardPanelSettingDto extends HardPanelSettingEntity {
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package com.bsd.pjcloud.hard.api.entity.panel;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 大屏配置表
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_panel_setting")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "大屏配置表")
|
||||
public class HardPanelSettingEntity extends Model<HardPanelSettingEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 营养分析-菜品排行-排除菜品分类
|
||||
*/
|
||||
@Schema(description = "营养分析-菜品排行-排除菜品分类")
|
||||
private String nutritionTopExcludeClassify;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除(0=正常 1=删除)
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除(0=正常 1=删除)")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description = "租户编号")
|
||||
private Long tenantId;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.panel;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.panel.HardPanelSettingEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardPanelSettingVo extends HardPanelSettingEntity {
|
||||
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.bsd.pjcloud.hard.controller.panel;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.hard.api.dto.panel.HardPanelSettingDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.panel.HardPanelSettingEntity;
|
||||
import com.bsd.pjcloud.hard.service.HardPanelSettingService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 大屏配置表
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hardPanelSetting")
|
||||
@Tag(description = "hardPanelSetting", name = "大屏配置表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardPanelSettingController {
|
||||
|
||||
private final HardPanelSettingService hardPanelSettingService;
|
||||
|
||||
@Operation(summary = "查询配置", description = "查询配置")
|
||||
@GetMapping("/")
|
||||
public R getSetting() {
|
||||
return R.ok(hardPanelSettingService.getSetting());
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "新增或修改", description = "新增或修改")
|
||||
@PostMapping
|
||||
public R<HardPanelSettingEntity> saveOrUpdate(@RequestBody HardPanelSettingDto dto) {
|
||||
return R.ok(hardPanelSettingService.selefSaveOrUpdate(dto));
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.bsd.pjcloud.hard.mapper.panel;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.entity.panel.HardPanelSettingEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardPanelSettingMapper extends PjcloudBaseMapper<HardPanelSettingEntity> {
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.hard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.dto.panel.HardPanelSettingDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.panel.HardPanelSettingEntity;
|
||||
|
||||
public interface HardPanelSettingService extends IService<HardPanelSettingEntity> {
|
||||
|
||||
/**
|
||||
* 查询配置
|
||||
*/
|
||||
HardPanelSettingEntity getSetting();
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
HardPanelSettingEntity selefSaveOrUpdate(HardPanelSettingDto dto);
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.bsd.pjcloud.hard.service.impl.panel;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.hard.api.dto.panel.HardPanelSettingDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.panel.HardPanelSettingEntity;
|
||||
import com.bsd.pjcloud.hard.mapper.panel.HardPanelSettingMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardPanelSettingService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 大屏配置表
|
||||
*/
|
||||
@Service
|
||||
public class HardPanelSettingServiceImpl extends ServiceImpl<HardPanelSettingMapper, HardPanelSettingEntity> implements HardPanelSettingService {
|
||||
|
||||
/**
|
||||
* 查询配置
|
||||
*/
|
||||
@Override
|
||||
public HardPanelSettingEntity getSetting() {
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
@Override
|
||||
public HardPanelSettingEntity selefSaveOrUpdate(HardPanelSettingDto dto) {
|
||||
HardPanelSettingEntity setting = getSetting();
|
||||
if (ObjectUtil.isEmpty(setting)) {
|
||||
baseMapper.insert(dto);
|
||||
} else {
|
||||
dto.setId(setting.getId());
|
||||
baseMapper.updateById(dto);
|
||||
}
|
||||
return setting;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.hard.mapper.panel.HardPanelSettingMapper">
|
||||
<resultMap id="hardPanelSettingMap" type="com.bsd.pjcloud.hard.api.entity.panel.HardPanelSettingEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="nutritionTopExcludeClassify" column="nutrition_top_exclude_classify"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user