diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwTemplateStyleController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwTemplateStyleController.java new file mode 100644 index 0000000..c4cc546 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwTemplateStyleController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +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.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwTemplateStyle; +import com.ruoyi.business.service.IHwTemplateStyleService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 场景化图风格信息Controller + * + * @author xins + * @date 2025-01-06 + */ +@RestController +@RequestMapping("/templateStyle") +public class HwTemplateStyleController extends BaseController +{ + @Autowired + private IHwTemplateStyleService hwTemplateStyleService; + + /** + * 查询场景化图风格信息列表 + */ +// @RequiresPermissions("business:templateStyle:list") + @GetMapping("/list") + public TableDataInfo list(HwTemplateStyle hwTemplateStyle) + { + startPage(); + List list = hwTemplateStyleService.selectHwTemplateStyleList(hwTemplateStyle); + return getDataTable(list); + } + + /** + * 导出场景化图风格信息列表 + */ + @RequiresPermissions("business:templateStyle:export") + @Log(title = "场景化图风格信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwTemplateStyle hwTemplateStyle) + { + List list = hwTemplateStyleService.selectHwTemplateStyleList(hwTemplateStyle); + ExcelUtil util = new ExcelUtil(HwTemplateStyle.class); + util.exportExcel(response, list, "场景化图风格信息数据"); + } + + /** + * 获取场景化图风格信息详细信息 + */ +// @RequiresPermissions("business:templateStyle:query") + @GetMapping(value = "/{templateStyleId}") + public AjaxResult getInfo(@PathVariable("templateStyleId") Long templateStyleId) + { + return success(hwTemplateStyleService.selectHwTemplateStyleByTemplateStyleId(templateStyleId)); + } + + /** + * 新增场景化图风格信息 + */ +// @RequiresPermissions("business:templateStyle:add") + @Log(title = "场景化图风格信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwTemplateStyle hwTemplateStyle) + { + return toAjax(hwTemplateStyleService.insertHwTemplateStyle(hwTemplateStyle)); + } + + /** + * 修改场景化图风格信息 + */ +// @RequiresPermissions("business:templateStyle:edit") + @Log(title = "场景化图风格信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwTemplateStyle hwTemplateStyle) + { + return toAjax(hwTemplateStyleService.updateHwTemplateStyle(hwTemplateStyle)); + } + + /** + * 删除场景化图风格信息 + */ + @RequiresPermissions("business:templateStyle:remove") + @Log(title = "场景化图风格信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{templateStyleIds}") + public AjaxResult remove(@PathVariable Long[] templateStyleIds) + { + return toAjax(hwTemplateStyleService.deleteHwTemplateStyleByTemplateStyleIds(templateStyleIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwTemplateStyle.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwTemplateStyle.java new file mode 100644 index 0000000..dd6f198 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwTemplateStyle.java @@ -0,0 +1,97 @@ +package com.ruoyi.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 场景化图风格信息对象 hw_template_style + * + * @author xins + * @date 2025-01-06 + */ +public class HwTemplateStyle extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 风格信息ID */ + private Long templateStyleId; + + /** 风格类型(0自定义,1风格1,2风格2,3风格3) */ + @Excel(name = "风格类型(0自定义,1风格1,2风格2,3风格3)") + private String templateStyleType; + + /** 基准颜色 */ + @Excel(name = "基准颜色") + private String baseColor; + + /** 字体颜色 */ + @Excel(name = "字体颜色") + private String fontColor; + + /** 颜色库,多个以,隔开 */ + @Excel(name = "颜色库,多个以,隔开") + private String colors; + + public void setTemplateStyleId(Long templateStyleId) + { + this.templateStyleId = templateStyleId; + } + + public Long getTemplateStyleId() + { + return templateStyleId; + } + public void setTemplateStyleType(String templateStyleType) + { + this.templateStyleType = templateStyleType; + } + + public String getTemplateStyleType() + { + return templateStyleType; + } + public void setBaseColor(String baseColor) + { + this.baseColor = baseColor; + } + + public String getBaseColor() + { + return baseColor; + } + public void setFontColor(String fontColor) + { + this.fontColor = fontColor; + } + + public String getFontColor() + { + return fontColor; + } + public void setColors(String colors) + { + this.colors = colors; + } + + public String getColors() + { + return colors; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("templateStyleId", getTemplateStyleId()) + .append("templateStyleType", getTemplateStyleType()) + .append("baseColor", getBaseColor()) + .append("fontColor", getFontColor()) + .append("colors", getColors()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwTemplateStyleMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwTemplateStyleMapper.java new file mode 100644 index 0000000..55ddbea --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwTemplateStyleMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwTemplateStyle; + +/** + * 场景化图风格信息Mapper接口 + * + * @author xins + * @date 2025-01-06 + */ +public interface HwTemplateStyleMapper +{ + /** + * 查询场景化图风格信息 + * + * @param templateStyleId 场景化图风格信息主键 + * @return 场景化图风格信息 + */ + public HwTemplateStyle selectHwTemplateStyleByTemplateStyleId(Long templateStyleId); + + /** + * 查询场景化图风格信息列表 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 场景化图风格信息集合 + */ + public List selectHwTemplateStyleList(HwTemplateStyle hwTemplateStyle); + + /** + * 新增场景化图风格信息 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 结果 + */ + public int insertHwTemplateStyle(HwTemplateStyle hwTemplateStyle); + + /** + * 修改场景化图风格信息 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 结果 + */ + public int updateHwTemplateStyle(HwTemplateStyle hwTemplateStyle); + + /** + * 删除场景化图风格信息 + * + * @param templateStyleId 场景化图风格信息主键 + * @return 结果 + */ + public int deleteHwTemplateStyleByTemplateStyleId(Long templateStyleId); + + /** + * 批量删除场景化图风格信息 + * + * @param templateStyleIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwTemplateStyleByTemplateStyleIds(Long[] templateStyleIds); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwTemplateStyleService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwTemplateStyleService.java new file mode 100644 index 0000000..172d07e --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwTemplateStyleService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwTemplateStyle; + +/** + * 场景化图风格信息Service接口 + * + * @author xins + * @date 2025-01-06 + */ +public interface IHwTemplateStyleService +{ + /** + * 查询场景化图风格信息 + * + * @param templateStyleId 场景化图风格信息主键 + * @return 场景化图风格信息 + */ + public HwTemplateStyle selectHwTemplateStyleByTemplateStyleId(Long templateStyleId); + + /** + * 查询场景化图风格信息列表 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 场景化图风格信息集合 + */ + public List selectHwTemplateStyleList(HwTemplateStyle hwTemplateStyle); + + /** + * 新增场景化图风格信息 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 结果 + */ + public int insertHwTemplateStyle(HwTemplateStyle hwTemplateStyle); + + /** + * 修改场景化图风格信息 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 结果 + */ + public int updateHwTemplateStyle(HwTemplateStyle hwTemplateStyle); + + /** + * 批量删除场景化图风格信息 + * + * @param templateStyleIds 需要删除的场景化图风格信息主键集合 + * @return 结果 + */ + public int deleteHwTemplateStyleByTemplateStyleIds(Long[] templateStyleIds); + + /** + * 删除场景化图风格信息信息 + * + * @param templateStyleId 场景化图风格信息主键 + * @return 结果 + */ + public int deleteHwTemplateStyleByTemplateStyleId(Long templateStyleId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwTemplateStyleServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwTemplateStyleServiceImpl.java new file mode 100644 index 0000000..58649a9 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwTemplateStyleServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwTemplateStyleMapper; +import com.ruoyi.business.domain.HwTemplateStyle; +import com.ruoyi.business.service.IHwTemplateStyleService; + +/** + * 场景化图风格信息Service业务层处理 + * + * @author xins + * @date 2025-01-06 + */ +@Service +public class HwTemplateStyleServiceImpl implements IHwTemplateStyleService +{ + @Autowired + private HwTemplateStyleMapper hwTemplateStyleMapper; + + /** + * 查询场景化图风格信息 + * + * @param templateStyleId 场景化图风格信息主键 + * @return 场景化图风格信息 + */ + @Override + public HwTemplateStyle selectHwTemplateStyleByTemplateStyleId(Long templateStyleId) + { + return hwTemplateStyleMapper.selectHwTemplateStyleByTemplateStyleId(templateStyleId); + } + + /** + * 查询场景化图风格信息列表 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 场景化图风格信息 + */ + @Override + public List selectHwTemplateStyleList(HwTemplateStyle hwTemplateStyle) + { + return hwTemplateStyleMapper.selectHwTemplateStyleList(hwTemplateStyle); + } + + /** + * 新增场景化图风格信息 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 结果 + */ + @Override + public int insertHwTemplateStyle(HwTemplateStyle hwTemplateStyle) + { + hwTemplateStyle.setCreateBy(SecurityUtils.getUsername()); + hwTemplateStyle.setCreateTime(DateUtils.getNowDate()); + return hwTemplateStyleMapper.insertHwTemplateStyle(hwTemplateStyle); + } + + /** + * 修改场景化图风格信息 + * + * @param hwTemplateStyle 场景化图风格信息 + * @return 结果 + */ + @Override + public int updateHwTemplateStyle(HwTemplateStyle hwTemplateStyle) + { + hwTemplateStyle.setUpdateBy(SecurityUtils.getUsername()); + hwTemplateStyle.setUpdateTime(DateUtils.getNowDate()); + return hwTemplateStyleMapper.updateHwTemplateStyle(hwTemplateStyle); + } + + /** + * 批量删除场景化图风格信息 + * + * @param templateStyleIds 需要删除的场景化图风格信息主键 + * @return 结果 + */ + @Override + public int deleteHwTemplateStyleByTemplateStyleIds(Long[] templateStyleIds) + { + return hwTemplateStyleMapper.deleteHwTemplateStyleByTemplateStyleIds(templateStyleIds); + } + + /** + * 删除场景化图风格信息信息 + * + * @param templateStyleId 场景化图风格信息主键 + * @return 结果 + */ + @Override + public int deleteHwTemplateStyleByTemplateStyleId(Long templateStyleId) + { + return hwTemplateStyleMapper.deleteHwTemplateStyleByTemplateStyleId(templateStyleId); + } +} diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwTemplateStyleMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwTemplateStyleMapper.xml new file mode 100644 index 0000000..f526e7e --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwTemplateStyleMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + select template_style_id, template_style_type, base_color, font_color, colors, create_by, create_time, update_by, update_time from hw_template_style + + + + + + + + insert into hw_template_style + + template_style_type, + base_color, + font_color, + colors, + create_by, + create_time, + update_by, + update_time, + + + #{templateStyleType}, + #{baseColor}, + #{fontColor}, + #{colors}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update hw_template_style + + template_style_type = #{templateStyleType}, + base_color = #{baseColor}, + font_color = #{fontColor}, + colors = #{colors}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where template_style_id = #{templateStyleId} + + + + delete from hw_template_style where template_style_id = #{templateStyleId} + + + + delete from hw_template_style where template_style_id in + + #{templateStyleId} + + + \ No newline at end of file