增加大屏后端;增加图片管理
This commit is contained in:
parent
8a7dcf8a80
commit
b2f457f53c
@ -0,0 +1,100 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.page.VisualRespData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.BladeVisualCategory;
|
||||
import com.ruoyi.system.service.IBladeVisualCategoryService;
|
||||
|
||||
/**
|
||||
* 可视化分类Controller
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/avue/api/category")
|
||||
public class BladeVisualCategoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBladeVisualCategoryService bladeVisualCategoryService;
|
||||
|
||||
/**
|
||||
* 查询可视化分类列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_category:list')")
|
||||
@GetMapping("/list")
|
||||
public VisualRespData list(BladeVisualCategory bladeVisualCategory)
|
||||
{
|
||||
startPage();
|
||||
List<BladeVisualCategory> list = bladeVisualCategoryService.selectBladeVisualCategoryList(bladeVisualCategory);
|
||||
return getVisualData(list);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出可视化分类列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_category:export')")
|
||||
// @Log(title = "可视化分类", businessType = BusinessType.EXPORT)
|
||||
// @GetMapping("/export")
|
||||
// public AjaxResult export(BladeVisualCategory bladeVisualCategory)
|
||||
// {
|
||||
// List<BladeVisualCategory> list = bladeVisualCategoryService.selectBladeVisualCategoryList(bladeVisualCategory);
|
||||
// ExcelUtil<BladeVisualCategory> util = new ExcelUtil<BladeVisualCategory>(BladeVisualCategory.class);
|
||||
// return util.exportExcel(list, "可视化分类数据");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取可视化分类详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_category:query')")
|
||||
@GetMapping(value = "/detail")
|
||||
public AjaxResult getInfo(Long id)
|
||||
{
|
||||
return AjaxResult.success(bladeVisualCategoryService.selectBladeVisualCategoryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增可视化分类
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_category:add')")
|
||||
@Log(title = "可视化分类", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/save")
|
||||
public AjaxResult add(@RequestBody BladeVisualCategory bladeVisualCategory)
|
||||
{
|
||||
return toAjax(bladeVisualCategoryService.insertBladeVisualCategory(bladeVisualCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化分类
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_category:edit')")
|
||||
@Log(title = "可视化分类", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public AjaxResult edit(@RequestBody BladeVisualCategory bladeVisualCategory)
|
||||
{
|
||||
return toAjax(bladeVisualCategoryService.updateBladeVisualCategory(bladeVisualCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化分类
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_category:remove')")
|
||||
@Log(title = "可视化分类", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(Long[] ids)
|
||||
{
|
||||
return toAjax(bladeVisualCategoryService.deleteBladeVisualCategoryByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.BladeVisualConfig;
|
||||
import com.ruoyi.system.service.IBladeVisualConfigService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 可视化配置Controller
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/avue/config")
|
||||
public class BladeVisualConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBladeVisualConfigService bladeVisualConfigService;
|
||||
|
||||
/**
|
||||
* 查询可视化配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:visual_config:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BladeVisualConfig bladeVisualConfig)
|
||||
{
|
||||
startPage();
|
||||
List<BladeVisualConfig> list = bladeVisualConfigService.selectBladeVisualConfigList(bladeVisualConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出可视化配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:visual_config:export')")
|
||||
@Log(title = "可视化配置", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(BladeVisualConfig bladeVisualConfig)
|
||||
{
|
||||
List<BladeVisualConfig> list = bladeVisualConfigService.selectBladeVisualConfigList(bladeVisualConfig);
|
||||
ExcelUtil<BladeVisualConfig> util = new ExcelUtil<BladeVisualConfig>(BladeVisualConfig.class);
|
||||
return util.exportExcel(list, "可视化配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可视化配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:visual_config:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(bladeVisualConfigService.selectBladeVisualConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增可视化配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:visual_config:add')")
|
||||
@Log(title = "可视化配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BladeVisualConfig bladeVisualConfig)
|
||||
{
|
||||
return toAjax(bladeVisualConfigService.insertBladeVisualConfig(bladeVisualConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:visual_config:edit')")
|
||||
@Log(title = "可视化配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BladeVisualConfig bladeVisualConfig)
|
||||
{
|
||||
return toAjax(bladeVisualConfigService.updateBladeVisualConfig(bladeVisualConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:visual_config:remove')")
|
||||
@Log(title = "可视化配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bladeVisualConfigService.deleteBladeVisualConfigByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.page.VisualRespEmbData;
|
||||
import com.ruoyi.system.service.impl.BladeVisualConfigServiceImpl;
|
||||
import com.ruoyi.web.param.BladeVisualParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.BladeVisual;
|
||||
import com.ruoyi.system.service.IBladeVisualService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 可视化Controller
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/avue/api/visual")
|
||||
public class BladeVisualController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBladeVisualService bladeVisualService;
|
||||
|
||||
/**
|
||||
* 查询可视化列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual:list')")
|
||||
@GetMapping("/list")
|
||||
public VisualRespEmbData list(Long category)
|
||||
{
|
||||
startPage();
|
||||
// List<BladeVisual> list = bladeVisualService.selectBladeVisualList(bladeVisual);
|
||||
List<BladeVisual> list = bladeVisualService.selectVisualListByCategory(category);
|
||||
return getVisualEmbData(list);
|
||||
// return getVisualData(list);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出可视化列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual:export')")
|
||||
// @Log(title = "可视化", businessType = BusinessType.EXPORT)
|
||||
// @GetMapping("/export")
|
||||
// public AjaxResult export(BladeVisual bladeVisual)
|
||||
// {
|
||||
// List<BladeVisual> list = bladeVisualService.selectBladeVisualList(bladeVisual);
|
||||
// ExcelUtil<BladeVisual> util = new ExcelUtil<BladeVisual>(BladeVisual.class);
|
||||
// return util.exportExcel(list, "可视化数据");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取可视化详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual:query')")
|
||||
@GetMapping(value = "/detail")
|
||||
public AjaxResult getInfo(Long id)
|
||||
{
|
||||
return AjaxResult.success(bladeVisualService.selectBladeVisualById(id));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
BladeVisualConfigServiceImpl configService;
|
||||
|
||||
/**
|
||||
* 新增可视化
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual:add')")
|
||||
@Log(title = "可视化", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/save")
|
||||
public AjaxResult add(@RequestBody BladeVisualParam param)
|
||||
{
|
||||
Long id = bladeVisualService.insertBladeVisual(param.getVisual());
|
||||
// 两个表id相同,方便检索
|
||||
param.getConfig().setId(id);
|
||||
param.getConfig().setVisualId(id);
|
||||
configService.insertBladeVisualConfig(param.getConfig());
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("id",String.valueOf(id));
|
||||
return new AjaxResult(200,"操作成功",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual:edit')")
|
||||
@Log(title = "可视化", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public AjaxResult edit(@RequestBody BladeVisualParam param)
|
||||
{
|
||||
int i = bladeVisualService.updateBladeVisual(param.getVisual());
|
||||
int j = configService.updateBladeVisualConfig(param.getConfig());
|
||||
return toAjax(i > 0 && j > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual:remove')")
|
||||
@Log(title = "可视化", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(Long[] ids)
|
||||
{
|
||||
return toAjax(bladeVisualService.deleteBladeVisualByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 处理大屏预览图片上传
|
||||
* @param file 图片
|
||||
* @return VisualRespEmbData
|
||||
*/
|
||||
@PostMapping("/put-file")
|
||||
public @ResponseBody VisualRespEmbData uploadImg(@RequestParam("file") MultipartFile file) {
|
||||
|
||||
//todo 前端每次更改了同一个大屏后,都重新上传一张新图片,文件名和原来不同,导致预览图片堆积。
|
||||
// 应更改前端,将大屏ID作为预览图片的文件名
|
||||
return bladeVisualService.uploadFile(file);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,106 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.page.VisualRespEmbData;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.BladeVisualMap;
|
||||
import com.ruoyi.system.service.IBladeVisualMapService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 可视化地图配置Controller
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/avue/api/map")
|
||||
public class BladeVisualMapController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBladeVisualMapService bladeVisualMapService;
|
||||
|
||||
/**
|
||||
* 查询可视化地图配置列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_map:list')")
|
||||
@GetMapping("/list")
|
||||
public VisualRespEmbData list(BladeVisualMap bladeVisualMap)
|
||||
{
|
||||
startPage();
|
||||
List<BladeVisualMap> list = bladeVisualMapService.selectBladeVisualMapList(bladeVisualMap);
|
||||
return getVisualEmbData(list);
|
||||
// return getDataTable(list);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出可视化地图配置列表
|
||||
// */
|
||||
//// @PreAuthorize("@ss.hasPermi('system:visual_map:export')")
|
||||
// @Log(title = "可视化地图配置", businessType = BusinessType.EXPORT)
|
||||
// @GetMapping("/export")
|
||||
// public AjaxResult export(BladeVisualMap bladeVisualMap)
|
||||
// {
|
||||
// List<BladeVisualMap> list = bladeVisualMapService.selectBladeVisualMapList(bladeVisualMap);
|
||||
// ExcelUtil<BladeVisualMap> util = new ExcelUtil<BladeVisualMap>(BladeVisualMap.class);
|
||||
// return util.exportExcel(list, "可视化地图配置数据");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取可视化地图配置详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_map:query')")
|
||||
@GetMapping(value = "/detail")
|
||||
public AjaxResult getInfo(Long id)
|
||||
{
|
||||
return AjaxResult.success(bladeVisualMapService.selectBladeVisualMapById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增可视化地图配置
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_map:add')")
|
||||
@Log(title = "可视化地图配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/save")
|
||||
public AjaxResult add(@RequestBody BladeVisualMap bladeVisualMap)
|
||||
{
|
||||
return toAjax(bladeVisualMapService.insertBladeVisualMap(bladeVisualMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化地图配置
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_map:edit')")
|
||||
@Log(title = "可视化地图配置", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public AjaxResult edit(@RequestBody BladeVisualMap bladeVisualMap)
|
||||
{
|
||||
return toAjax(bladeVisualMapService.updateBladeVisualMap(bladeVisualMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化地图配置
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:visual_map:remove')")
|
||||
@Log(title = "可视化地图配置", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(Long[] ids)
|
||||
{
|
||||
return toAjax(bladeVisualMapService.deleteBladeVisualMapByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import com.ruoyi.web.param.VisualImageAddParam;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.VisualImage;
|
||||
import com.ruoyi.system.service.IVisualImageService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 图片管理。管理上传的图片Controller
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/visualImage")
|
||||
public class VisualImageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IVisualImageService visualImageService;
|
||||
|
||||
/**
|
||||
* 查询图片管理。管理上传的图片列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:image:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(VisualImage visualImage)
|
||||
{
|
||||
startPage();
|
||||
List<VisualImage> list = visualImageService.selectVisualImageList(visualImage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出图片
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:image:export')")
|
||||
@Log(title = "图片管理。管理上传的图片", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(VisualImage visualImage)
|
||||
{
|
||||
List<VisualImage> list = visualImageService.selectVisualImageList(visualImage);
|
||||
ExcelUtil<VisualImage> util = new ExcelUtil<VisualImage>(VisualImage.class);
|
||||
return util.exportExcel(list, "图片管理。管理上传的图片数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:image:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(visualImageService.selectVisualImageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增图片
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:image:add')")
|
||||
@Log(title = "图片管理。管理上传的图片", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody VisualImage visualImage)
|
||||
{
|
||||
String name = SecurityContextHolder.getContext().getAuthentication().getName();
|
||||
visualImage.setCreateBy(name);
|
||||
visualImageService.divideImage(visualImage);
|
||||
return toAjax(visualImageService.insertVisualImage(visualImage));
|
||||
}
|
||||
|
||||
// @Value("${imageDir.visualImage}")
|
||||
// private String imageDir;
|
||||
|
||||
|
||||
// @PreAuthorize("@ss.hasPermi('system:image:add')")
|
||||
// @Log(title = "图片管理。管理上传的图片", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/upload")
|
||||
private AjaxResult uploadImage(@RequestParam MultipartFile file){
|
||||
//todo BUG这里自动注入失败,调用服务会报空指针异常
|
||||
// String newFileName = visualImageService.saveImageToLocal(file);
|
||||
String imageDir = "/images";
|
||||
String filePath = RuoYiConfig.getProfile() + imageDir;
|
||||
File targetFile = new File(filePath);
|
||||
if (!targetFile.exists()) {
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
String[] fileNameSplit = file.getOriginalFilename().split("\\.");
|
||||
String fileType = fileNameSplit[fileNameSplit.length - 1];
|
||||
|
||||
String newFileName = UUID.fastUUID().toString(true) + "." + fileType;
|
||||
String fullFileName = filePath + "/" + newFileName;
|
||||
try {
|
||||
FileOutputStream out = new FileOutputStream(fullFileName);
|
||||
out.write(file.getBytes());
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("name",newFileName);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:image:edit')")
|
||||
@Log(title = "图片管理。管理上传的图片", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody VisualImage visualImage)
|
||||
{
|
||||
String name = SecurityContextHolder.getContext().getAuthentication().getName();
|
||||
visualImage.setUpdateBy(name);
|
||||
return toAjax(visualImageService.updateVisualImage(visualImage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:image:remove')")
|
||||
@Log(title = "图片管理。管理上传的图片", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(visualImageService.deleteVisualImageByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.ruoyi.web.param;
|
||||
|
||||
import com.ruoyi.system.domain.BladeVisual;
|
||||
import com.ruoyi.system.domain.BladeVisualConfig;
|
||||
|
||||
public class BladeVisualParam {
|
||||
private BladeVisualConfig config;
|
||||
|
||||
private BladeVisual visual;
|
||||
|
||||
public BladeVisualParam() {
|
||||
}
|
||||
|
||||
public BladeVisualConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public void setConfig(BladeVisualConfig config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public BladeVisual getVisual() {
|
||||
return visual;
|
||||
}
|
||||
|
||||
public void setVisual(BladeVisual visual) {
|
||||
this.visual = visual;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VisualAddParam{" +
|
||||
"config=" + config +
|
||||
", visual=" + visual +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.ruoyi.web.param;
|
||||
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
public class VisualImageAddParam {
|
||||
private MultipartFile file;
|
||||
|
||||
private Integer width;
|
||||
|
||||
private Integer heigth;
|
||||
|
||||
public VisualImageAddParam() {
|
||||
}
|
||||
|
||||
public MultipartFile getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(MultipartFile file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public Integer getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(Integer width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public Integer getHeigth() {
|
||||
return heigth;
|
||||
}
|
||||
|
||||
public void setHeigth(Integer heigth) {
|
||||
this.heigth = heigth;
|
||||
}
|
||||
}
|
@ -6,16 +6,16 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://172.17.172.240:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: password
|
||||
password: 123456
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
@ -35,7 +35,7 @@ spring:
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
@ -54,4 +54,4 @@ spring:
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
multi-statement-allow: true
|
||||
|
@ -9,12 +9,20 @@ ruoyi:
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
# profile: F:/ruoyi/uploadPath
|
||||
profile: /home/yangsj/bigScreen
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数组计算 char 字符验证
|
||||
captchaType: math
|
||||
|
||||
imageDir:
|
||||
# 大屏的预览图片存放文件夹名
|
||||
bigScreen: /overview
|
||||
# 其他图片存放文件夹名
|
||||
visualImage: /images
|
||||
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
@ -42,7 +50,7 @@ spring:
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
profiles:
|
||||
active: druid
|
||||
# 文件上传
|
||||
servlet:
|
||||
@ -59,13 +67,13 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
host: 172.17.172.240
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
database: 4
|
||||
# 密码
|
||||
password:
|
||||
password: ydd123456
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
@ -87,7 +95,7 @@ token:
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
# 搜索指定包别名
|
||||
@ -98,10 +106,10 @@ mybatis:
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
@ -111,10 +119,16 @@ swagger:
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
|
||||
#bigScreen:
|
||||
# prefix: /overview
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/home/ruoyi/logs" />
|
||||
<property name="log.path" value="/home/yangsj/logs" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-info.log</file>
|
||||
@ -34,7 +34,7 @@
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
@ -56,7 +56,7 @@
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 用户访问日志输出 -->
|
||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-user.log</file>
|
||||
@ -70,7 +70,7 @@
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
@ -79,15 +79,15 @@
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
|
||||
|
||||
<!--系统用户操作日志-->
|
||||
<logger name="sys-user" level="info">
|
||||
<appender-ref ref="sys-user"/>
|
||||
</logger>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
@ -52,7 +52,7 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- JSON工具类 -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
@ -118,7 +118,6 @@
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -3,6 +3,8 @@ package com.ruoyi.common.core.controller;
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.page.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
@ -12,9 +14,6 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -22,7 +21,7 @@ import com.ruoyi.common.utils.sql.SqlUtil;
|
||||
|
||||
/**
|
||||
* web层通用数据处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class BaseController
|
||||
@ -89,6 +88,31 @@ public class BaseController
|
||||
return rspData;
|
||||
}
|
||||
|
||||
protected VisualRespData getVisualData(List<?> list){
|
||||
VisualRespData respData = new VisualRespData();
|
||||
respData.setCode(HttpStatus.SUCCESS);
|
||||
respData.setSuccess(true);
|
||||
respData.setMsg("操作成功");
|
||||
respData.setData(list);
|
||||
return respData;
|
||||
}
|
||||
|
||||
protected VisualRespEmbData getVisualEmbData(List<?> list){
|
||||
VisualRespEmbData respData = new VisualRespEmbData();
|
||||
VisualData data = new VisualData();
|
||||
PageInfo<?> pageInfo = new PageInfo<>(list);
|
||||
data.setTotal(pageInfo.getTotal());
|
||||
data.setCurrent(pageInfo.getPageNum());
|
||||
data.setRecords(list);
|
||||
respData.setData(data);
|
||||
|
||||
return respData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
@ -123,7 +147,7 @@ public class BaseController
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
*
|
||||
* @param rows 影响行数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ -134,7 +158,7 @@ public class BaseController
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
*
|
||||
* @param result 结果
|
||||
* @return 操作结果
|
||||
*/
|
||||
|
@ -0,0 +1,84 @@
|
||||
package com.ruoyi.common.core.page;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class VisualData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
this.hitCount = false;
|
||||
this.searchCount = true;
|
||||
// this.orders =
|
||||
}
|
||||
private Integer current;
|
||||
private Boolean hitCount;
|
||||
|
||||
private List<?> orders;
|
||||
|
||||
private Integer pages;
|
||||
private List<?> records;
|
||||
private Boolean searchCount;
|
||||
private Long total;
|
||||
|
||||
public VisualData() {
|
||||
}
|
||||
|
||||
public Integer getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public void setCurrent(Integer current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
public Boolean getHitCount() {
|
||||
return hitCount;
|
||||
}
|
||||
|
||||
public void setHitCount(Boolean hitCount) {
|
||||
this.hitCount = hitCount;
|
||||
}
|
||||
|
||||
public List<?> getOrders() {
|
||||
return orders;
|
||||
}
|
||||
|
||||
public void setOrders(List<?> orders) {
|
||||
this.orders = orders;
|
||||
}
|
||||
|
||||
public Integer getPages() {
|
||||
return pages;
|
||||
}
|
||||
|
||||
public void setPages(Integer pages) {
|
||||
this.pages = pages;
|
||||
}
|
||||
|
||||
public List<?> getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
public void setRecords(List<?> records) {
|
||||
this.records = records;
|
||||
}
|
||||
|
||||
public Boolean getSearchCount() {
|
||||
return searchCount;
|
||||
}
|
||||
|
||||
public void setSearchCount(Boolean searchCount) {
|
||||
this.searchCount = searchCount;
|
||||
}
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.ruoyi.common.core.page;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class VisualRespData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 消息状态码 */
|
||||
private int code;
|
||||
|
||||
private Boolean success;
|
||||
|
||||
private String msg;
|
||||
|
||||
private List<?> data;
|
||||
|
||||
public VisualRespData() {
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Boolean getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<?> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<?> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VisualRespData{" +
|
||||
"code=" + code +
|
||||
", success=" + success +
|
||||
", data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.ruoyi.common.core.page;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class VisualRespEmbData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
this.code = 200;
|
||||
this.msg = "操作成功";
|
||||
this.success = true;
|
||||
}
|
||||
|
||||
|
||||
/** 消息状态码 */
|
||||
private int code;
|
||||
|
||||
private Boolean success;
|
||||
|
||||
private String msg;
|
||||
|
||||
private Object data;
|
||||
|
||||
public VisualRespEmbData() {
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Boolean getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VisualRespEmbData{" +
|
||||
"code=" + code +
|
||||
", success=" + success +
|
||||
", msg='" + msg + '\'' +
|
||||
", data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||
|
||||
/**
|
||||
* spring security配置
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||
@ -31,7 +31,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
*/
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
|
||||
/**
|
||||
* 认证失败处理类
|
||||
*/
|
||||
@ -49,13 +49,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
*/
|
||||
@Autowired
|
||||
private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
||||
|
||||
|
||||
/**
|
||||
* 跨域过滤器
|
||||
*/
|
||||
@Autowired
|
||||
private CorsFilter corsFilter;
|
||||
|
||||
|
||||
/**
|
||||
* 解决 无法直接注入 AuthenticationManager
|
||||
*
|
||||
@ -107,6 +107,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
"/**/*.js",
|
||||
"/profile/**"
|
||||
).permitAll()
|
||||
.antMatchers("/avue/**").anonymous()
|
||||
.antMatchers("/system/visualImage/upload").anonymous()
|
||||
.antMatchers("/swagger-ui.html").anonymous()
|
||||
.antMatchers("/swagger-resources/**").anonymous()
|
||||
.antMatchers("/webjars/**").anonymous()
|
||||
|
@ -0,0 +1,139 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 可视化对象 blade_visual
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public class BladeVisual extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 大屏标题 */
|
||||
@Excel(name = "大屏标题")
|
||||
private String title;
|
||||
|
||||
/** 预览图地址 */
|
||||
@Excel(name = "预览图地址")
|
||||
private String backgroundUrl;
|
||||
|
||||
/** 大屏类型 */
|
||||
@Excel(name = "大屏类型")
|
||||
private Long category;
|
||||
|
||||
/** 发布密码 */
|
||||
@Excel(name = "发布密码")
|
||||
private String password;
|
||||
|
||||
/** 鍒涘缓閮ㄩ棬 */
|
||||
@Excel(name = "鍒涘缓閮ㄩ棬")
|
||||
private Long createDept;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Long status;
|
||||
|
||||
/** 鏄惁宸插垹闄? */
|
||||
@Excel(name = "鏄惁宸插垹闄?")
|
||||
private Long isdeleted;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
public void setBackgroundUrl(String backgroundUrl)
|
||||
{
|
||||
this.backgroundUrl = backgroundUrl;
|
||||
}
|
||||
|
||||
public String getBackgroundUrl()
|
||||
{
|
||||
return backgroundUrl;
|
||||
}
|
||||
public void setCategory(Long category)
|
||||
{
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public Long getCategory()
|
||||
{
|
||||
return category;
|
||||
}
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
public void setCreateDept(Long createDept)
|
||||
{
|
||||
this.createDept = createDept;
|
||||
}
|
||||
|
||||
public Long getCreateDept()
|
||||
{
|
||||
return createDept;
|
||||
}
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setIsdeleted(Long isdeleted)
|
||||
{
|
||||
this.isdeleted = isdeleted;
|
||||
}
|
||||
|
||||
public Long getIsdeleted()
|
||||
{
|
||||
return isdeleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("title", getTitle())
|
||||
.append("backgroundUrl", getBackgroundUrl())
|
||||
.append("category", getCategory())
|
||||
.append("password", getPassword())
|
||||
.append("createDept", getCreateDept())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("status", getStatus())
|
||||
.append("isdeleted", getIsdeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 可视化分类对象 blade_visual_category
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public class BladeVisualCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 鍒嗙被閿€? */
|
||||
@Excel(name = "鍒嗙被閿€?")
|
||||
private String categoryKey;
|
||||
|
||||
/** 鍒嗙被鍚嶇О */
|
||||
@Excel(name = "鍒嗙被鍚嶇О")
|
||||
private String categoryValue;
|
||||
|
||||
/** 鏄惁宸插垹闄? */
|
||||
@Excel(name = "鏄惁宸插垹闄?")
|
||||
private Long isDeleted;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCategoryKey(String categoryKey)
|
||||
{
|
||||
this.categoryKey = categoryKey;
|
||||
}
|
||||
|
||||
public String getCategoryKey()
|
||||
{
|
||||
return categoryKey;
|
||||
}
|
||||
public void setCategoryValue(String categoryValue)
|
||||
{
|
||||
this.categoryValue = categoryValue;
|
||||
}
|
||||
|
||||
public String getCategoryValue()
|
||||
{
|
||||
return categoryValue;
|
||||
}
|
||||
public void setIsDeleted(Long isDeleted)
|
||||
{
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
public Long getIsDeleted()
|
||||
{
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("categoryKey", getCategoryKey())
|
||||
.append("categoryValue", getCategoryValue())
|
||||
.append("isDeleted", getIsDeleted())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 可视化配置对象 blade_visual_config
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public class BladeVisualConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 鍙鍖栬〃涓婚敭 */
|
||||
@Excel(name = "鍙鍖栬〃涓婚敭")
|
||||
private Long visualId;
|
||||
|
||||
/** 配置json */
|
||||
@Excel(name = "配置json")
|
||||
private String detail;
|
||||
|
||||
/** 组件json */
|
||||
@Excel(name = "组件json")
|
||||
private String component;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setVisualId(Long visualId)
|
||||
{
|
||||
this.visualId = visualId;
|
||||
}
|
||||
|
||||
public Long getVisualId()
|
||||
{
|
||||
return visualId;
|
||||
}
|
||||
public void setDetail(String detail)
|
||||
{
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
public String getDetail()
|
||||
{
|
||||
return detail;
|
||||
}
|
||||
public void setComponent(String component)
|
||||
{
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public String getComponent()
|
||||
{
|
||||
return component;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("visualId", getVisualId())
|
||||
.append("detail", getDetail())
|
||||
.append("component", getComponent())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 可视化地图配置对象 blade_visual_map
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public class BladeVisualMap extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 地图名称 */
|
||||
@Excel(name = "地图名称")
|
||||
private String name;
|
||||
|
||||
/** 地图数据 */
|
||||
@Excel(name = "地图数据")
|
||||
private String data;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setData(String data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("data", getData())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
|
||||
/**
|
||||
* 图片管理。管理上传的图片对象 visual_image
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-28
|
||||
*/
|
||||
public class VisualImage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 原始文件名 */
|
||||
@Excel(name = "原始文件名")
|
||||
private String originName;
|
||||
|
||||
/** 新生成的文件名 */
|
||||
@Excel(name = "新生成的文件名")
|
||||
private String newName;
|
||||
|
||||
/** 沿宽度切割的个数 */
|
||||
@Excel(name = "沿宽度切割的个数")
|
||||
@Min(value = 1)
|
||||
private Integer width;
|
||||
|
||||
/** 沿高度切割的个数 */
|
||||
@Excel(name = "沿高度切割的个数")
|
||||
@Min(value = 1)
|
||||
private Integer height;
|
||||
|
||||
/** 描述信息 */
|
||||
@Excel(name = "描述信息")
|
||||
private String descri;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOriginName(String originName)
|
||||
{
|
||||
this.originName = originName;
|
||||
}
|
||||
|
||||
public String getOriginName()
|
||||
{
|
||||
return originName;
|
||||
}
|
||||
public void setNewName(String newName)
|
||||
{
|
||||
this.newName = newName;
|
||||
}
|
||||
|
||||
public String getNewName()
|
||||
{
|
||||
return newName;
|
||||
}
|
||||
public void setWidth(Integer width)
|
||||
{
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public Integer getWidth()
|
||||
{
|
||||
return width;
|
||||
}
|
||||
public void setHeight(Integer height)
|
||||
{
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public Integer getHeight()
|
||||
{
|
||||
return height;
|
||||
}
|
||||
|
||||
public String getDescri() {
|
||||
return descri;
|
||||
}
|
||||
|
||||
public void setDescri(String descri) {
|
||||
this.descri = descri;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("originName", getOriginName())
|
||||
.append("newName", getNewName())
|
||||
.append("width", getWidth())
|
||||
.append("height", getHeight())
|
||||
.append("descri", getDescri())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
public class BladeImageVo {
|
||||
String domain;
|
||||
|
||||
String link;
|
||||
|
||||
String name;
|
||||
|
||||
String originalName;
|
||||
|
||||
public BladeImageVo() {
|
||||
}
|
||||
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getOriginalName() {
|
||||
return originalName;
|
||||
}
|
||||
|
||||
public void setOriginalName(String originalName) {
|
||||
this.originalName = originalName;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.ruoyi.system.domain.BladeVisual;
|
||||
import com.ruoyi.system.domain.BladeVisualConfig;
|
||||
|
||||
public class BladeVisualVo {
|
||||
private BladeVisualConfig config;
|
||||
|
||||
private BladeVisual visual;
|
||||
|
||||
public BladeVisualVo() {
|
||||
}
|
||||
|
||||
public BladeVisualConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public void setConfig(BladeVisualConfig config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public BladeVisual getVisual() {
|
||||
return visual;
|
||||
}
|
||||
|
||||
public void setVisual(BladeVisual visual) {
|
||||
this.visual = visual;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BladeVisualVo{" +
|
||||
"config=" + config +
|
||||
", visual=" + visual +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BladeVisualCategory;
|
||||
|
||||
/**
|
||||
* 可视化分类Mapper接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface BladeVisualCategoryMapper
|
||||
{
|
||||
/**
|
||||
* 查询可视化分类
|
||||
*
|
||||
* @param id 可视化分类主键
|
||||
* @return 可视化分类
|
||||
*/
|
||||
public BladeVisualCategory selectBladeVisualCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询可视化分类列表
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 可视化分类集合
|
||||
*/
|
||||
public List<BladeVisualCategory> selectBladeVisualCategoryList(BladeVisualCategory bladeVisualCategory);
|
||||
|
||||
/**
|
||||
* 新增可视化分类
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBladeVisualCategory(BladeVisualCategory bladeVisualCategory);
|
||||
|
||||
/**
|
||||
* 修改可视化分类
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisualCategory(BladeVisualCategory bladeVisualCategory);
|
||||
|
||||
/**
|
||||
* 删除可视化分类
|
||||
*
|
||||
* @param id 可视化分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除可视化分类
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualCategoryByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BladeVisualConfig;
|
||||
|
||||
/**
|
||||
* 可视化配置Mapper接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface BladeVisualConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询可视化配置
|
||||
*
|
||||
* @param id 可视化配置主键
|
||||
* @return 可视化配置
|
||||
*/
|
||||
public BladeVisualConfig selectBladeVisualConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询可视化配置列表
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 可视化配置集合
|
||||
*/
|
||||
public List<BladeVisualConfig> selectBladeVisualConfigList(BladeVisualConfig bladeVisualConfig);
|
||||
|
||||
/**
|
||||
* 新增可视化配置
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBladeVisualConfig(BladeVisualConfig bladeVisualConfig);
|
||||
|
||||
/**
|
||||
* 修改可视化配置
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisualConfig(BladeVisualConfig bladeVisualConfig);
|
||||
|
||||
/**
|
||||
* 删除可视化配置
|
||||
*
|
||||
* @param id 可视化配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除可视化配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualConfigByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BladeVisualMap;
|
||||
|
||||
/**
|
||||
* 可视化地图配置Mapper接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface BladeVisualMapMapper
|
||||
{
|
||||
/**
|
||||
* 查询可视化地图配置
|
||||
*
|
||||
* @param id 可视化地图配置主键
|
||||
* @return 可视化地图配置
|
||||
*/
|
||||
public BladeVisualMap selectBladeVisualMapById(Long id);
|
||||
|
||||
/**
|
||||
* 查询可视化地图配置列表
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 可视化地图配置集合
|
||||
*/
|
||||
public List<BladeVisualMap> selectBladeVisualMapList(BladeVisualMap bladeVisualMap);
|
||||
|
||||
/**
|
||||
* 新增可视化地图配置
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBladeVisualMap(BladeVisualMap bladeVisualMap);
|
||||
|
||||
/**
|
||||
* 修改可视化地图配置
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisualMap(BladeVisualMap bladeVisualMap);
|
||||
|
||||
/**
|
||||
* 删除可视化地图配置
|
||||
*
|
||||
* @param id 可视化地图配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualMapById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除可视化地图配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualMapByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BladeVisual;
|
||||
|
||||
/**
|
||||
* 可视化Mapper接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface BladeVisualMapper
|
||||
{
|
||||
/**
|
||||
* 查询可视化
|
||||
*
|
||||
* @param id 可视化主键
|
||||
* @return 可视化
|
||||
*/
|
||||
public BladeVisual selectBladeVisualById(Long id);
|
||||
|
||||
/**
|
||||
* 通过分类查找大屏
|
||||
* @param category 分类
|
||||
* @return 大屏列表
|
||||
*/
|
||||
List<BladeVisual> selectVisualByCategory(Long category);
|
||||
|
||||
/**
|
||||
* 查询可视化列表
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 可视化集合
|
||||
*/
|
||||
public List<BladeVisual> selectBladeVisualList(BladeVisual bladeVisual);
|
||||
|
||||
/**
|
||||
* 新增可视化
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBladeVisual(BladeVisual bladeVisual);
|
||||
|
||||
/**
|
||||
* 修改可视化
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisual(BladeVisual bladeVisual);
|
||||
|
||||
/**
|
||||
* 删除可视化
|
||||
*
|
||||
* @param id 可视化主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除可视化
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualByIds(Long[] ids);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.VisualImage;
|
||||
|
||||
/**
|
||||
* 图片管理。管理上传的图片Mapper接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-28
|
||||
*/
|
||||
public interface VisualImageMapper
|
||||
{
|
||||
/**
|
||||
* 查询图片管理。管理上传的图片
|
||||
*
|
||||
* @param id 图片管理。管理上传的图片主键
|
||||
* @return 图片管理。管理上传的图片
|
||||
*/
|
||||
public VisualImage selectVisualImageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询图片管理。管理上传的图片列表
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 图片管理。管理上传的图片集合
|
||||
*/
|
||||
public List<VisualImage> selectVisualImageList(VisualImage visualImage);
|
||||
|
||||
/**
|
||||
* 新增图片管理。管理上传的图片
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertVisualImage(VisualImage visualImage);
|
||||
|
||||
/**
|
||||
* 修改图片管理。管理上传的图片
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateVisualImage(VisualImage visualImage);
|
||||
|
||||
/**
|
||||
* 删除图片管理。管理上传的图片
|
||||
*
|
||||
* @param id 图片管理。管理上传的图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVisualImageById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除图片管理。管理上传的图片
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVisualImageByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BladeVisualCategory;
|
||||
|
||||
/**
|
||||
* 可视化分类Service接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface IBladeVisualCategoryService
|
||||
{
|
||||
/**
|
||||
* 查询可视化分类
|
||||
*
|
||||
* @param id 可视化分类主键
|
||||
* @return 可视化分类
|
||||
*/
|
||||
public BladeVisualCategory selectBladeVisualCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询可视化分类列表
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 可视化分类集合
|
||||
*/
|
||||
public List<BladeVisualCategory> selectBladeVisualCategoryList(BladeVisualCategory bladeVisualCategory);
|
||||
|
||||
/**
|
||||
* 新增可视化分类
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBladeVisualCategory(BladeVisualCategory bladeVisualCategory);
|
||||
|
||||
/**
|
||||
* 修改可视化分类
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisualCategory(BladeVisualCategory bladeVisualCategory);
|
||||
|
||||
/**
|
||||
* 批量删除可视化分类
|
||||
*
|
||||
* @param ids 需要删除的可视化分类主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualCategoryByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除可视化分类信息
|
||||
*
|
||||
* @param id 可视化分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualCategoryById(Long id);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BladeVisualConfig;
|
||||
|
||||
/**
|
||||
* 可视化配置Service接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface IBladeVisualConfigService
|
||||
{
|
||||
/**
|
||||
* 查询可视化配置
|
||||
*
|
||||
* @param id 可视化配置主键
|
||||
* @return 可视化配置
|
||||
*/
|
||||
public BladeVisualConfig selectBladeVisualConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询可视化配置列表
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 可视化配置集合
|
||||
*/
|
||||
public List<BladeVisualConfig> selectBladeVisualConfigList(BladeVisualConfig bladeVisualConfig);
|
||||
|
||||
/**
|
||||
* 新增可视化配置
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBladeVisualConfig(BladeVisualConfig bladeVisualConfig);
|
||||
|
||||
/**
|
||||
* 修改可视化配置
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisualConfig(BladeVisualConfig bladeVisualConfig);
|
||||
|
||||
/**
|
||||
* 批量删除可视化配置
|
||||
*
|
||||
* @param ids 需要删除的可视化配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除可视化配置信息
|
||||
*
|
||||
* @param id 可视化配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualConfigById(Long id);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BladeVisualMap;
|
||||
|
||||
/**
|
||||
* 可视化地图配置Service接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface IBladeVisualMapService
|
||||
{
|
||||
/**
|
||||
* 查询可视化地图配置
|
||||
*
|
||||
* @param id 可视化地图配置主键
|
||||
* @return 可视化地图配置
|
||||
*/
|
||||
public BladeVisualMap selectBladeVisualMapById(Long id);
|
||||
|
||||
/**
|
||||
* 查询可视化地图配置列表
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 可视化地图配置集合
|
||||
*/
|
||||
public List<BladeVisualMap> selectBladeVisualMapList(BladeVisualMap bladeVisualMap);
|
||||
|
||||
/**
|
||||
* 新增可视化地图配置
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBladeVisualMap(BladeVisualMap bladeVisualMap);
|
||||
|
||||
/**
|
||||
* 修改可视化地图配置
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisualMap(BladeVisualMap bladeVisualMap);
|
||||
|
||||
/**
|
||||
* 批量删除可视化地图配置
|
||||
*
|
||||
* @param ids 需要删除的可视化地图配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualMapByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除可视化地图配置信息
|
||||
*
|
||||
* @param id 可视化地图配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualMapById(Long id);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.page.VisualRespEmbData;
|
||||
import com.ruoyi.system.domain.BladeVisual;
|
||||
import com.ruoyi.system.domain.vo.BladeVisualVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 可视化Service接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
public interface IBladeVisualService
|
||||
{
|
||||
/**
|
||||
* 查询可视化
|
||||
*
|
||||
* @param id 可视化主键
|
||||
* @return 可视化
|
||||
*/
|
||||
public BladeVisualVo selectBladeVisualById(Long id);
|
||||
|
||||
/**
|
||||
* 查询可视化列表
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 可视化集合
|
||||
*/
|
||||
public List<BladeVisual> selectBladeVisualList(BladeVisual bladeVisual);
|
||||
|
||||
/**
|
||||
* 新增可视化
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 结果
|
||||
*/
|
||||
public Long insertBladeVisual(BladeVisual bladeVisual);
|
||||
|
||||
/**
|
||||
* 修改可视化
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBladeVisual(BladeVisual bladeVisual);
|
||||
|
||||
/**
|
||||
* 批量删除可视化
|
||||
*
|
||||
* @param ids 需要删除的可视化主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除可视化信息
|
||||
*
|
||||
* @param id 可视化主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBladeVisualById(Long id);
|
||||
|
||||
List<BladeVisual> selectVisualListByCategory(Long category);
|
||||
|
||||
VisualRespEmbData uploadFile(MultipartFile file);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.VisualImage;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 图片管理。管理上传的图片Service接口
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-28
|
||||
*/
|
||||
public interface IVisualImageService
|
||||
{
|
||||
/**
|
||||
* 查询图片管理。管理上传的图片
|
||||
*
|
||||
* @param id 图片管理。管理上传的图片主键
|
||||
* @return 图片管理。管理上传的图片
|
||||
*/
|
||||
public VisualImage selectVisualImageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询图片管理。管理上传的图片列表
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 图片管理。管理上传的图片集合
|
||||
*/
|
||||
public List<VisualImage> selectVisualImageList(VisualImage visualImage);
|
||||
|
||||
/**
|
||||
* 新增图片管理。管理上传的图片
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertVisualImage(VisualImage visualImage);
|
||||
|
||||
/**
|
||||
* 修改图片管理。管理上传的图片
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateVisualImage(VisualImage visualImage);
|
||||
|
||||
/**
|
||||
* 批量删除图片管理。管理上传的图片
|
||||
*
|
||||
* @param ids 需要删除的图片管理。管理上传的图片主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVisualImageByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除图片管理。管理上传的图片信息
|
||||
*
|
||||
* @param id 图片管理。管理上传的图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVisualImageById(Long id);
|
||||
|
||||
int addImage(MultipartFile file, Integer heigth, Integer width);
|
||||
|
||||
String saveImageToLocal(MultipartFile file);
|
||||
|
||||
int divideImage(VisualImage visualImage);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BladeVisualCategoryMapper;
|
||||
import com.ruoyi.system.domain.BladeVisualCategory;
|
||||
import com.ruoyi.system.service.IBladeVisualCategoryService;
|
||||
|
||||
/**
|
||||
* 可视化分类Service业务层处理
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@Service
|
||||
public class BladeVisualCategoryServiceImpl implements IBladeVisualCategoryService
|
||||
{
|
||||
@Autowired
|
||||
private BladeVisualCategoryMapper bladeVisualCategoryMapper;
|
||||
|
||||
/**
|
||||
* 查询可视化分类
|
||||
*
|
||||
* @param id 可视化分类主键
|
||||
* @return 可视化分类
|
||||
*/
|
||||
@Override
|
||||
public BladeVisualCategory selectBladeVisualCategoryById(Long id)
|
||||
{
|
||||
return bladeVisualCategoryMapper.selectBladeVisualCategoryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可视化分类列表
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 可视化分类
|
||||
*/
|
||||
@Override
|
||||
public List<BladeVisualCategory> selectBladeVisualCategoryList(BladeVisualCategory bladeVisualCategory)
|
||||
{
|
||||
return bladeVisualCategoryMapper.selectBladeVisualCategoryList(bladeVisualCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增可视化分类
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBladeVisualCategory(BladeVisualCategory bladeVisualCategory)
|
||||
{
|
||||
return bladeVisualCategoryMapper.insertBladeVisualCategory(bladeVisualCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化分类
|
||||
*
|
||||
* @param bladeVisualCategory 可视化分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBladeVisualCategory(BladeVisualCategory bladeVisualCategory)
|
||||
{
|
||||
return bladeVisualCategoryMapper.updateBladeVisualCategory(bladeVisualCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除可视化分类
|
||||
*
|
||||
* @param ids 需要删除的可视化分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualCategoryByIds(Long[] ids)
|
||||
{
|
||||
return bladeVisualCategoryMapper.deleteBladeVisualCategoryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化分类信息
|
||||
*
|
||||
* @param id 可视化分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualCategoryById(Long id)
|
||||
{
|
||||
return bladeVisualCategoryMapper.deleteBladeVisualCategoryById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BladeVisualConfigMapper;
|
||||
import com.ruoyi.system.domain.BladeVisualConfig;
|
||||
import com.ruoyi.system.service.IBladeVisualConfigService;
|
||||
|
||||
/**
|
||||
* 可视化配置Service业务层处理
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@Service
|
||||
public class BladeVisualConfigServiceImpl implements IBladeVisualConfigService
|
||||
{
|
||||
@Autowired
|
||||
private BladeVisualConfigMapper bladeVisualConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询可视化配置
|
||||
*
|
||||
* @param id 可视化配置主键
|
||||
* @return 可视化配置
|
||||
*/
|
||||
@Override
|
||||
public BladeVisualConfig selectBladeVisualConfigById(Long id)
|
||||
{
|
||||
return bladeVisualConfigMapper.selectBladeVisualConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可视化配置列表
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 可视化配置
|
||||
*/
|
||||
@Override
|
||||
public List<BladeVisualConfig> selectBladeVisualConfigList(BladeVisualConfig bladeVisualConfig)
|
||||
{
|
||||
return bladeVisualConfigMapper.selectBladeVisualConfigList(bladeVisualConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增可视化配置
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBladeVisualConfig(BladeVisualConfig bladeVisualConfig)
|
||||
{
|
||||
return bladeVisualConfigMapper.insertBladeVisualConfig(bladeVisualConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化配置
|
||||
*
|
||||
* @param bladeVisualConfig 可视化配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBladeVisualConfig(BladeVisualConfig bladeVisualConfig)
|
||||
{
|
||||
return bladeVisualConfigMapper.updateBladeVisualConfig(bladeVisualConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除可视化配置
|
||||
*
|
||||
* @param ids 需要删除的可视化配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualConfigByIds(Long[] ids)
|
||||
{
|
||||
return bladeVisualConfigMapper.deleteBladeVisualConfigByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化配置信息
|
||||
*
|
||||
* @param id 可视化配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualConfigById(Long id)
|
||||
{
|
||||
return bladeVisualConfigMapper.deleteBladeVisualConfigById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BladeVisualMapMapper;
|
||||
import com.ruoyi.system.domain.BladeVisualMap;
|
||||
import com.ruoyi.system.service.IBladeVisualMapService;
|
||||
|
||||
/**
|
||||
* 可视化地图配置Service业务层处理
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@Service
|
||||
public class BladeVisualMapServiceImpl implements IBladeVisualMapService
|
||||
{
|
||||
@Autowired
|
||||
private BladeVisualMapMapper bladeVisualMapMapper;
|
||||
|
||||
/**
|
||||
* 查询可视化地图配置
|
||||
*
|
||||
* @param id 可视化地图配置主键
|
||||
* @return 可视化地图配置
|
||||
*/
|
||||
@Override
|
||||
public BladeVisualMap selectBladeVisualMapById(Long id)
|
||||
{
|
||||
return bladeVisualMapMapper.selectBladeVisualMapById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可视化地图配置列表
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 可视化地图配置
|
||||
*/
|
||||
@Override
|
||||
public List<BladeVisualMap> selectBladeVisualMapList(BladeVisualMap bladeVisualMap)
|
||||
{
|
||||
return bladeVisualMapMapper.selectBladeVisualMapList(bladeVisualMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增可视化地图配置
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBladeVisualMap(BladeVisualMap bladeVisualMap)
|
||||
{
|
||||
return bladeVisualMapMapper.insertBladeVisualMap(bladeVisualMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化地图配置
|
||||
*
|
||||
* @param bladeVisualMap 可视化地图配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBladeVisualMap(BladeVisualMap bladeVisualMap)
|
||||
{
|
||||
return bladeVisualMapMapper.updateBladeVisualMap(bladeVisualMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除可视化地图配置
|
||||
*
|
||||
* @param ids 需要删除的可视化地图配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualMapByIds(Long[] ids)
|
||||
{
|
||||
return bladeVisualMapMapper.deleteBladeVisualMapByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化地图配置信息
|
||||
*
|
||||
* @param id 可视化地图配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualMapById(Long id)
|
||||
{
|
||||
return bladeVisualMapMapper.deleteBladeVisualMapById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.page.VisualRespEmbData;
|
||||
import com.ruoyi.system.domain.BladeVisualConfig;
|
||||
import com.ruoyi.system.domain.vo.BladeImageVo;
|
||||
import com.ruoyi.system.domain.vo.BladeVisualVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BladeVisualMapper;
|
||||
import com.ruoyi.system.domain.BladeVisual;
|
||||
import com.ruoyi.system.service.IBladeVisualService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 可视化Service业务层处理
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-25
|
||||
*/
|
||||
@Service
|
||||
public class BladeVisualServiceImpl implements IBladeVisualService
|
||||
{
|
||||
@Autowired
|
||||
private BladeVisualMapper bladeVisualMapper;
|
||||
|
||||
@Autowired
|
||||
private BladeVisualConfigServiceImpl configService;
|
||||
/**
|
||||
* 查询可视化
|
||||
*
|
||||
* @param id 可视化主键
|
||||
* @return 可视化
|
||||
*/
|
||||
@Override
|
||||
public BladeVisualVo selectBladeVisualById(Long id)
|
||||
{
|
||||
BladeVisualVo bladeVisualVo = new BladeVisualVo();
|
||||
BladeVisual bladeVisual = bladeVisualMapper.selectBladeVisualById(id);
|
||||
BladeVisualConfig config = configService.selectBladeVisualConfigById(id);
|
||||
bladeVisualVo.setVisual(bladeVisual);
|
||||
bladeVisualVo.setConfig(config);
|
||||
return bladeVisualVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可视化列表
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 可视化
|
||||
*/
|
||||
@Override
|
||||
public List<BladeVisual> selectBladeVisualList(BladeVisual bladeVisual)
|
||||
{
|
||||
return bladeVisualMapper.selectBladeVisualList(bladeVisual);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BladeVisual> selectVisualListByCategory(Long category) {
|
||||
return bladeVisualMapper.selectVisualByCategory(category);
|
||||
}
|
||||
|
||||
@Value("${server.port}")
|
||||
private int serverPort;
|
||||
|
||||
public String getUrl() {
|
||||
InetAddress address = null;
|
||||
try {
|
||||
address = InetAddress.getLocalHost();
|
||||
} catch ( UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "http://"+address.getHostAddress() +":"+this.serverPort;
|
||||
}
|
||||
|
||||
@Value("${imageDir.bigScreen}")
|
||||
private String screenPrefix;
|
||||
|
||||
@Override
|
||||
public VisualRespEmbData uploadFile(MultipartFile file) {
|
||||
// 保存到本地
|
||||
String filePath = RuoYiConfig.getProfile() + screenPrefix;
|
||||
File targetFile = new File(filePath);
|
||||
if (!targetFile.exists()) {
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
String filename = file.getOriginalFilename();
|
||||
String fullFileName = filePath + "/" + filename;
|
||||
// System.out.println("image fullName"+fullFileName);
|
||||
try {
|
||||
FileOutputStream out = new FileOutputStream(fullFileName);
|
||||
out.write(file.getBytes());
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
VisualRespEmbData resp = new VisualRespEmbData();
|
||||
|
||||
BladeImageVo imageVo = new BladeImageVo();
|
||||
imageVo.setDomain(filePath);
|
||||
String link = this.getUrl() + Constants.RESOURCE_PREFIX +screenPrefix +"/"+filename;
|
||||
imageVo.setLink(link);
|
||||
resp.setData(imageVo);
|
||||
return resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增可视化
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Long insertBladeVisual(BladeVisual bladeVisual)
|
||||
{
|
||||
|
||||
bladeVisual.setId(System.currentTimeMillis());
|
||||
|
||||
bladeVisualMapper.insertBladeVisual(bladeVisual);
|
||||
return bladeVisual.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改可视化
|
||||
*
|
||||
* @param bladeVisual 可视化
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBladeVisual(BladeVisual bladeVisual)
|
||||
{
|
||||
return bladeVisualMapper.updateBladeVisual(bladeVisual);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除可视化
|
||||
*
|
||||
* @param ids 需要删除的可视化主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualByIds(Long[] ids)
|
||||
{
|
||||
return bladeVisualMapper.deleteBladeVisualByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除可视化信息
|
||||
*
|
||||
* @param id 可视化主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBladeVisualById(Long id)
|
||||
{
|
||||
return bladeVisualMapper.deleteBladeVisualById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,195 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.VisualImageMapper;
|
||||
import com.ruoyi.system.domain.VisualImage;
|
||||
import com.ruoyi.system.service.IVisualImageService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
/**
|
||||
* 图片管理。管理上传的图片Service业务层处理
|
||||
*
|
||||
* @author yangsj
|
||||
* @date 2021-10-28
|
||||
*/
|
||||
@Service
|
||||
public class VisualImageServiceImpl implements IVisualImageService {
|
||||
@Autowired
|
||||
private VisualImageMapper visualImageMapper;
|
||||
|
||||
/**
|
||||
* 查询图片管理。管理上传的图片
|
||||
*
|
||||
* @param id 图片管理。管理上传的图片主键
|
||||
* @return 图片管理。管理上传的图片
|
||||
*/
|
||||
@Override
|
||||
public VisualImage selectVisualImageById(Long id) {
|
||||
return visualImageMapper.selectVisualImageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图片管理。管理上传的图片列表
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 图片管理。管理上传的图片
|
||||
*/
|
||||
@Override
|
||||
public List<VisualImage> selectVisualImageList(VisualImage visualImage) {
|
||||
return visualImageMapper.selectVisualImageList(visualImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增图片管理。管理上传的图片
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertVisualImage(VisualImage visualImage) {
|
||||
visualImage.setCreateTime(DateUtils.getNowDate());
|
||||
return visualImageMapper.insertVisualImage(visualImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图片管理。管理上传的图片
|
||||
*
|
||||
* @param visualImage 图片管理。管理上传的图片
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateVisualImage(VisualImage visualImage) {
|
||||
visualImage.setUpdateTime(DateUtils.getNowDate());
|
||||
return visualImageMapper.updateVisualImage(visualImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除图片管理。管理上传的图片
|
||||
*
|
||||
* @param ids 需要删除的图片管理。管理上传的图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteVisualImageByIds(Long[] ids) {
|
||||
return visualImageMapper.deleteVisualImageByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片管理。管理上传的图片信息
|
||||
*
|
||||
* @param id 图片管理。管理上传的图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteVisualImageById(Long id) {
|
||||
return visualImageMapper.deleteVisualImageById(id);
|
||||
}
|
||||
|
||||
|
||||
@Value("${imageDir.visualImage}")
|
||||
private String imageDir;
|
||||
|
||||
@Override
|
||||
public int addImage(MultipartFile file, Integer heigth, Integer width) {
|
||||
// 1.保存到图片本地
|
||||
saveImageToLocal(file);
|
||||
|
||||
// 2.插入记录到数据库
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveImageToLocal(MultipartFile file) {
|
||||
String filePath = RuoYiConfig.getProfile() + imageDir;
|
||||
File targetFile = new File(filePath);
|
||||
if (!targetFile.exists()) {
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
String[] fileNameSplit = file.getOriginalFilename().split("\\.");
|
||||
String fileType = fileNameSplit[fileNameSplit.length - 1];
|
||||
|
||||
String newFileName = UUID.fastUUID().toString(true) + "." + fileType;
|
||||
String fullFileName = filePath + "/" + newFileName;
|
||||
try {
|
||||
FileOutputStream out = new FileOutputStream(fullFileName);
|
||||
out.write(file.getBytes());
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return newFileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int divideImage(VisualImage visualImage) {
|
||||
String rootPath = RuoYiConfig.getProfile() + imageDir;
|
||||
String newFileName = rootPath + "/" + visualImage.getNewName();
|
||||
// 读入大图
|
||||
File file = new File(newFileName);
|
||||
FileInputStream fis;
|
||||
try {
|
||||
fis = new FileInputStream(file);
|
||||
BufferedImage image = ImageIO.read(fis);
|
||||
|
||||
// 分割成4*4(16)个小图
|
||||
int rows = visualImage.getHeight();
|
||||
int cols = visualImage.getWidth();
|
||||
int chunks = rows * cols;
|
||||
|
||||
// 计算每个小图的宽度和高度
|
||||
int chunkWidth = image.getWidth() / cols;
|
||||
int chunkHeight = image.getHeight() / rows;
|
||||
|
||||
// 新建文件夹存放子图
|
||||
String[] split = visualImage.getNewName().split("\\.");
|
||||
String outputDir = rootPath + "/" + split[0];
|
||||
File targetFile = new File(outputDir);
|
||||
if (!targetFile.exists()) {
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
BufferedImage imgs[] = new BufferedImage[chunks];
|
||||
for (int x = 0; x < rows; x++) {
|
||||
for (int y = 0; y < cols; y++) {
|
||||
//设置小图的大小和类型
|
||||
imgs[count] = new BufferedImage(chunkWidth, chunkHeight, image.getType());
|
||||
|
||||
//写入图像内容
|
||||
Graphics2D gr = imgs[count].createGraphics();
|
||||
gr.drawImage(image, 0, 0,
|
||||
chunkWidth, chunkHeight,
|
||||
chunkWidth * y, chunkHeight * x,
|
||||
chunkWidth * y + chunkWidth,
|
||||
chunkHeight * x + chunkHeight, null);
|
||||
gr.dispose();
|
||||
|
||||
// 输出小图
|
||||
String outFileName = outputDir + "/" + x + "_" + y + "." + split[split.length - 1];
|
||||
ImageIO.write(imgs[count], split[split.length - 1], new File(outFileName));
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
<?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.ruoyi.system.mapper.BladeVisualCategoryMapper">
|
||||
|
||||
<resultMap type="BladeVisualCategory" id="BladeVisualCategoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="categoryKey" column="category_key" />
|
||||
<result property="categoryValue" column="category_value" />
|
||||
<result property="isDeleted" column="is_deleted" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBladeVisualCategoryVo">
|
||||
select id, category_key, category_value, is_deleted from blade_visual_category
|
||||
</sql>
|
||||
|
||||
<select id="selectBladeVisualCategoryList" parameterType="BladeVisualCategory" resultMap="BladeVisualCategoryResult">
|
||||
<include refid="selectBladeVisualCategoryVo"/>
|
||||
<where>
|
||||
<if test="categoryKey != null and categoryKey != ''"> and category_key = #{categoryKey}</if>
|
||||
<if test="categoryValue != null and categoryValue != ''"> and category_value = #{categoryValue}</if>
|
||||
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBladeVisualCategoryById" parameterType="Long" resultMap="BladeVisualCategoryResult">
|
||||
<include refid="selectBladeVisualCategoryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBladeVisualCategory" parameterType="BladeVisualCategory">
|
||||
insert into blade_visual_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="categoryKey != null">category_key,</if>
|
||||
<if test="categoryValue != null">category_value,</if>
|
||||
<if test="isDeleted != null">is_deleted,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="categoryKey != null">#{categoryKey},</if>
|
||||
<if test="categoryValue != null">#{categoryValue},</if>
|
||||
<if test="isDeleted != null">#{isDeleted},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBladeVisualCategory" parameterType="BladeVisualCategory">
|
||||
update blade_visual_category
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="categoryKey != null">category_key = #{categoryKey},</if>
|
||||
<if test="categoryValue != null">category_value = #{categoryValue},</if>
|
||||
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBladeVisualCategoryById" parameterType="Long">
|
||||
delete from blade_visual_category where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBladeVisualCategoryByIds" parameterType="String">
|
||||
delete from blade_visual_category where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,68 @@
|
||||
<?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.ruoyi.system.mapper.BladeVisualConfigMapper">
|
||||
|
||||
<resultMap type="BladeVisualConfig" id="BladeVisualConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="visualId" column="visual_id" />
|
||||
<result property="detail" column="detail" />
|
||||
<result property="component" column="component" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBladeVisualConfigVo">
|
||||
select id, visual_id, detail, component from blade_visual_config
|
||||
</sql>
|
||||
|
||||
<select id="selectBladeVisualConfigList" parameterType="BladeVisualConfig" resultMap="BladeVisualConfigResult">
|
||||
<include refid="selectBladeVisualConfigVo"/>
|
||||
<where>
|
||||
<if test="visualId != null "> and visual_id = #{visualId}</if>
|
||||
<if test="detail != null and detail != ''"> and detail = #{detail}</if>
|
||||
<if test="component != null and component != ''"> and component = #{component}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBladeVisualConfigById" parameterType="Long" resultMap="BladeVisualConfigResult">
|
||||
<include refid="selectBladeVisualConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBladeVisualConfig" parameterType="BladeVisualConfig">
|
||||
insert into blade_visual_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="visualId != null">visual_id,</if>
|
||||
<if test="detail != null">detail,</if>
|
||||
<if test="component != null">component,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="visualId != null">#{visualId},</if>
|
||||
<if test="detail != null">#{detail},</if>
|
||||
<if test="component != null">#{component},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBladeVisualConfig" parameterType="BladeVisualConfig">
|
||||
update blade_visual_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="visualId != null">visual_id = #{visualId},</if>
|
||||
<if test="detail != null">detail = #{detail},</if>
|
||||
<if test="component != null">component = #{component},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBladeVisualConfigById" parameterType="Long">
|
||||
delete from blade_visual_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBladeVisualConfigByIds" parameterType="String">
|
||||
delete from blade_visual_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,63 @@
|
||||
<?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.ruoyi.system.mapper.BladeVisualMapMapper">
|
||||
|
||||
<resultMap type="BladeVisualMap" id="BladeVisualMapResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="data" column="data" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBladeVisualMapVo">
|
||||
select id, name, data from blade_visual_map
|
||||
</sql>
|
||||
|
||||
<select id="selectBladeVisualMapList" parameterType="BladeVisualMap" resultMap="BladeVisualMapResult">
|
||||
<include refid="selectBladeVisualMapVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="data != null and data != ''"> and data = #{data}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBladeVisualMapById" parameterType="Long" resultMap="BladeVisualMapResult">
|
||||
<include refid="selectBladeVisualMapVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBladeVisualMap" parameterType="BladeVisualMap">
|
||||
insert into blade_visual_map
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="data != null">data,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="data != null">#{data},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBladeVisualMap" parameterType="BladeVisualMap">
|
||||
update blade_visual_map
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="data != null">data = #{data},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBladeVisualMapById" parameterType="Long">
|
||||
delete from blade_visual_map where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBladeVisualMapByIds" parameterType="String">
|
||||
delete from blade_visual_map where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,109 @@
|
||||
<?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.ruoyi.system.mapper.BladeVisualMapper">
|
||||
|
||||
<resultMap type="BladeVisual" id="BladeVisualResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="backgroundUrl" column="background_url" />
|
||||
<result property="category" column="category" />
|
||||
<result property="password" column="password" />
|
||||
<result property="createDept" column="create_dept" />
|
||||
<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="status" column="status" />
|
||||
<result property="isdeleted" column="isDeleted" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBladeVisualVo">
|
||||
select id, title, background_url, category, password, create_dept, create_by, create_time, update_by, update_time, status, isDeleted from blade_visual
|
||||
</sql>
|
||||
|
||||
<select id="selectBladeVisualList" parameterType="BladeVisual" resultMap="BladeVisualResult">
|
||||
<include refid="selectBladeVisualVo"/>
|
||||
<where>
|
||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||
<if test="backgroundUrl != null and backgroundUrl != ''"> and background_url = #{backgroundUrl}</if>
|
||||
<if test="category != null "> and category = #{category}</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="createDept != null "> and create_dept = #{createDept}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="isdeleted != null "> and isDeleted = #{isdeleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBladeVisualById" parameterType="Long" resultMap="BladeVisualResult">
|
||||
<include refid="selectBladeVisualVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectVisualByCategory" parameterType="Long" resultMap="BladeVisualResult">
|
||||
<include refid="selectBladeVisualVo"/>
|
||||
where category = #{category}
|
||||
</select>
|
||||
|
||||
<insert id="insertBladeVisual" parameterType="BladeVisual">
|
||||
insert into blade_visual
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="title != null">title,</if>
|
||||
<if test="backgroundUrl != null">background_url,</if>
|
||||
<if test="category != null">category,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="createDept != null">create_dept,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="isdeleted != null">isDeleted,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="backgroundUrl != null">#{backgroundUrl},</if>
|
||||
<if test="category != null">#{category},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="createDept != null">#{createDept},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="isdeleted != null">#{isdeleted},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBladeVisual" parameterType="BladeVisual">
|
||||
update blade_visual
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="backgroundUrl != null">background_url = #{backgroundUrl},</if>
|
||||
<if test="category != null">category = #{category},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="createDept != null">create_dept = #{createDept},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="isdeleted != null">isDeleted = #{isdeleted},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBladeVisualById" parameterType="Long">
|
||||
delete from blade_visual where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBladeVisualByIds" parameterType="String">
|
||||
delete from blade_visual where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,96 @@
|
||||
<?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.ruoyi.system.mapper.VisualImageMapper">
|
||||
|
||||
<resultMap type="VisualImage" id="VisualImageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="originName" column="origin_name" />
|
||||
<result property="newName" column="new_name" />
|
||||
<result property="width" column="width" />
|
||||
<result property="height" column="height" />
|
||||
<result property="descri" column="descri" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectVisualImageVo">
|
||||
select id, origin_name, new_name, width, height, descri, del_flag, create_by, create_time, update_by, update_time from visual_image
|
||||
</sql>
|
||||
|
||||
<select id="selectVisualImageList" parameterType="VisualImage" resultMap="VisualImageResult">
|
||||
<include refid="selectVisualImageVo"/>
|
||||
<where>
|
||||
<if test="originName != null and originName != ''"> and origin_name like concat('%', #{originName}, '%')</if>
|
||||
<if test="newName != null and newName != ''"> and new_name like concat('%', #{newName}, '%')</if>
|
||||
<if test="width != null "> and width = #{width}</if>
|
||||
<if test="height != null "> and height = #{height}</if>
|
||||
<if test="descri != null and descri != ''"> and descri = #{descri}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectVisualImageById" parameterType="Long" resultMap="VisualImageResult">
|
||||
<include refid="selectVisualImageVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertVisualImage" parameterType="VisualImage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into visual_image
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="originName != null">origin_name,</if>
|
||||
<if test="newName != null">new_name,</if>
|
||||
<if test="width != null">width,</if>
|
||||
<if test="height != null">height,</if>
|
||||
<if test="descri != null">descri,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="originName != null">#{originName},</if>
|
||||
<if test="newName != null">#{newName},</if>
|
||||
<if test="width != null">#{width},</if>
|
||||
<if test="height != null">#{height},</if>
|
||||
<if test="descri != null">#{descri},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateVisualImage" parameterType="VisualImage">
|
||||
update visual_image
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="originName != null">origin_name = #{originName},</if>
|
||||
<if test="newName != null">new_name = #{newName},</if>
|
||||
<if test="width != null">width = #{width},</if>
|
||||
<if test="height != null">height = #{height},</if>
|
||||
<if test="descri != null">descri = #{descri},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteVisualImageById" parameterType="Long">
|
||||
delete from visual_image where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteVisualImageByIds" parameterType="String">
|
||||
delete from visual_image where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,11 +1,13 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
|
||||
port = 8090
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
62
ruoyi-ui/src/api/system/visualImage.js
Normal file
62
ruoyi-ui/src/api/system/visualImage.js
Normal file
@ -0,0 +1,62 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询图片管理。管理上传的图片列表
|
||||
export function listVisualImage(query) {
|
||||
return request({
|
||||
url: '/system/visualImage/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询图片管理。管理上传的图片详细
|
||||
export function getVisualImage(id) {
|
||||
return request({
|
||||
url: '/system/visualImage/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增图片管理。管理上传的图片
|
||||
export function addVisualImage(data) {
|
||||
return request({
|
||||
url: '/system/visualImage',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改图片管理。管理上传的图片
|
||||
export function updateVisualImage(data) {
|
||||
return request({
|
||||
url: '/system/visualImage',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除图片管理。管理上传的图片
|
||||
export function delVisualImage(id) {
|
||||
return request({
|
||||
url: '/system/visualImage/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出图片管理。管理上传的图片
|
||||
export function exportVisualImage(query) {
|
||||
return request({
|
||||
url: '/system/visualImage/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出图片管理。管理上传的图片
|
||||
export function uploadImage(query) {
|
||||
return request({
|
||||
url: '/system/visualImage/upload',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
53
ruoyi-ui/src/image.js
Normal file
53
ruoyi-ui/src/image.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询图片管理。管理上传的图片列表
|
||||
export function listImage(query) {
|
||||
return request({
|
||||
url: '/system/image/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询图片管理。管理上传的图片详细
|
||||
export function getImage(id) {
|
||||
return request({
|
||||
url: '/system/image/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增图片管理。管理上传的图片
|
||||
export function addImage(data) {
|
||||
return request({
|
||||
url: '/system/image',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改图片管理。管理上传的图片
|
||||
export function updateImage(data) {
|
||||
return request({
|
||||
url: '/system/image',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除图片管理。管理上传的图片
|
||||
export function delImage(id) {
|
||||
return request({
|
||||
url: '/system/image/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出图片管理。管理上传的图片
|
||||
export function exportImage(query) {
|
||||
return request({
|
||||
url: '/system/image/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
19
ruoyi-ui/src/views/screen/screenEdit/index.vue
Normal file
19
ruoyi-ui/src/views/screen/screenEdit/index.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>hello world</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default{
|
||||
name:"screenEdit",
|
||||
data(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
331
ruoyi-ui/src/views/screen/visualImage/index.vue
Normal file
331
ruoyi-ui/src/views/screen/visualImage/index.vue
Normal file
@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label-width=100px label="原始文件名" prop="originName">
|
||||
<el-input v-model="queryParams.originName" placeholder="请输入原始文件名" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label-width=100px label="新文件名" prop="newName">
|
||||
<el-input v-model="queryParams.newName" placeholder="请输入新文件名" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="切割宽度" prop="width">
|
||||
<el-input v-model="queryParams.width" placeholder="请输入切割宽度" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="高度切割" prop="height">
|
||||
<el-input v-model="queryParams.height" placeholder="请输入切割高度" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['system:visualImage:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:visualImage:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:visualImage:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading"
|
||||
@click="handleExport" v-hasPermi="['system:visualImage:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="visualImageList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="id" align="center" prop="id" />
|
||||
<el-table-column label="原始文件名" align="center" prop="originName" />
|
||||
<el-table-column label="新文件名" align="center" prop="newName" />
|
||||
<el-table-column label="切割宽高" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span >{{ scope.row.width + " × " + scope.row.height}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- <el-table-column label="切割高度" align="center" prop="height" /> -->
|
||||
<el-table-column label="描述信息" align="center" prop="descri" />
|
||||
<el-table-column label="创建者" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新者" align="center" prop="updateBy" />
|
||||
<el-table-column label="更新者" align="center" prop="updateTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:visualImage:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:visualImage:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改图片管理。管理上传的图片对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<!-- <el-form-item label="原始文件名" prop="originName">
|
||||
<el-input v-model="form.originName" placeholder="请输入原始文件名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="新生成的文件名" prop="newName">
|
||||
<el-input v-model="form.newName" placeholder="请输入新生成的文件名" />
|
||||
</el-form-item> -->
|
||||
<el-upload class="avatar-uploader" action="http://localhost:8080/system/visualImage/upload"
|
||||
:before-upload="beforeUpload" :show-file-list="false" :on-success="handleAvatarSuccess">
|
||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
<el-form-item label="宽度" prop="width">
|
||||
<el-input v-model="form.width" placeholder="请输入切割宽度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="高度" prop="height">
|
||||
<el-input v-model="form.height" placeholder="请输入切割高度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述信息" prop="descri">
|
||||
<el-input v-model="form.descri" placeholder="请输入描述信息" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listVisualImage,
|
||||
getVisualImage,
|
||||
delVisualImage,
|
||||
addVisualImage,
|
||||
updateVisualImage,
|
||||
exportVisualImage
|
||||
} from "@/api/system/visualImage";
|
||||
// import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: "VisualImage",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 图片管理。管理上传的图片表格数据
|
||||
visualImageList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
originName: null,
|
||||
newName: null,
|
||||
width: null,
|
||||
height: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
imageUrl:null,
|
||||
uploadHeader: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
mounted() {
|
||||
// this.uploadHeader['Content-Type'] = 'multipart/form-data'
|
||||
// this.uploadHeader['Authorization'] = 'Bearer ' + getToken()
|
||||
// console.log(this.uploadHeader);
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log(res, file);
|
||||
this.form.originName = file.name
|
||||
this.form.newName = res.data.name
|
||||
this.imageUrl = URL.createObjectURL(file.raw);
|
||||
},
|
||||
beforeUpload(file) {
|
||||
//
|
||||
this.form.newName = null
|
||||
return true;
|
||||
},
|
||||
/** 查询图片管理。管理上传的图片列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listVisualImage(this.queryParams).then(response => {
|
||||
this.visualImageList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
originName: null,
|
||||
newName: null,
|
||||
width: null,
|
||||
height: null,
|
||||
descri: null,
|
||||
delFlag: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.imageUrl = null
|
||||
this.open = true;
|
||||
this.title = "添加图片";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.imageUrl = null
|
||||
const id = row.id || this.ids
|
||||
getVisualImage(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改图片";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateVisualImage(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
if (this.form.newName == null) {
|
||||
this.$modal.msgSuccess("请等待图片上传完成");
|
||||
return;
|
||||
}
|
||||
addVisualImage(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除图片管理。管理上传的图片编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delVisualImage(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$modal.confirm('是否确认导出所有图片管理。管理上传的图片数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportVisualImage(queryParams);
|
||||
}).then(response => {
|
||||
this.$download.name(response.msg);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #000000;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #ff0000;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
142
sql/avue-data.sql
Normal file
142
sql/avue-data.sql
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user