diff --git a/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java b/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java index 84478b071..2b038d654 100644 --- a/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java +++ b/pqs-common/common-oss/src/main/java/com/njcn/oss/constant/OssPath.java @@ -126,5 +126,9 @@ public interface OssPath { */ String GOVERN_HARMONIC_FILE="govern/harmonic/"; + /** + * 主题 + */ + String THEME="theme/"; } diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/GridServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/GridServiceImpl.java index 9ce911fd4..f5dbe27bd 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/GridServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/GridServiceImpl.java @@ -683,7 +683,7 @@ public class GridServiceImpl implements IGridService { int ubalanceTime = list33.stream() .mapToInt(RStatLimitRateDPO::getUbalanceOvertime) .sum(); - comAssess.setQualifyData(allTime <= 0 ? 3.14159:PubUtils.doubleRound(2,100-(devTime+freqTime+thdTime+pltTime+ubalanceTime)/(allTime*500.0))); + comAssess.setQualifyData(allTime <= 0 ? 3.14159:PubUtils.doubleRound(2,100-(devTime+freqTime+thdTime+pltTime+ubalanceTime)*100.0/(allTime*5))); comAssess.setVDevQualifyData(allTime <= 0 ? 3.14159:PubUtils.doubleRound(2,100-devTime*100.0/allTime)); comAssess.setFreqQualifyData(allTime <= 0 ? 3.14159:PubUtils.doubleRound(2,100-freqTime*100.0/allTime)); comAssess.setHarmQualifyData(allTime <= 0 ? 3.14159:PubUtils.doubleRound(2,100-thdTime*100.0/allTime)); diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/ThemeParam.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/ThemeParam.java index afaafbeb1..7599a1f6a 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/ThemeParam.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/ThemeParam.java @@ -11,6 +11,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; +import java.util.List; /** * 类的介绍: @@ -45,6 +46,42 @@ public class ThemeParam { @NotNull(message = ValidMessage.FAVICON_NOT_BLANK) private MultipartFile faviconFile; + @ApiModelProperty("切换栏位置") + private String mainAnimation; + + @ApiModelProperty("主键主题色") + private List elementUiPrimary; + + @ApiModelProperty("表格标题背景颜色") + private List tableHeaderBackground; + + @ApiModelProperty("表格标题文字颜色") + private List tableHeaderColor; + + @ApiModelProperty("表格激活颜色") + private List tableCurrent; + + @ApiModelProperty("侧边菜单背景色") + private List menuBackground; + + @ApiModelProperty("侧边菜单文字颜色") + private List menuColor; + + @ApiModelProperty("侧边菜单激活项背景色") + private List menuActiveBackground; + + @ApiModelProperty("侧边菜单激活项文字色") + private List menuActiveColor; + + @ApiModelProperty("侧边菜单顶栏背景色") + private List menuTopBarBackground; + + @ApiModelProperty("顶栏文字色") + private List headerBarTabColor; + + @ApiModelProperty("顶栏背景色") + private List headerBarBackground; + /** * 用户更新操作实体 * diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/Theme.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/Theme.java index 26d0fd94b..5d151d78f 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/Theme.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/Theme.java @@ -58,4 +58,63 @@ public class Theme extends BaseEntity { */ private Integer state; + //V3主题使用的字段 + /** + * 切换栏位置 + */ + private String mainAnimation; + /** + * 主键主题色 + */ + private String elementUiPrimary; + /** + * 表格标题背景颜色 + */ + private String tableHeaderBackground; + /** + * 表格标题文字颜色 + */ + private String tableHeaderColor; + /** + * 表格激活颜色 + */ + private String tableCurrent; + /** + * 侧边菜单背景色 + */ + private String menuBackground; + /** + * 侧边菜单文字颜色 + */ + private String menuColor; + /** + * 侧边菜单激活项背景色 + */ + private String menuActiveBackground; + /** + * 侧边菜单激活项文字色 + */ + private String menuActiveColor; + /** + * 侧边菜单顶栏背景色 + */ + private String menuTopBarBackground; + /** + * 顶栏文字色 + */ + private String headerBarTabColor; + /** + * 顶栏背景色 + */ + private String headerBarBackground; + + /** + * logo文件服务器路径 + */ + private String logoPath; + /** + * favicon文件服务器路径 + */ + private String faviconPath; + } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/ThemeServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/ThemeServiceImpl.java index 403a87a62..fd7ed121d 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/ThemeServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/ThemeServiceImpl.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.oss.constant.OssPath; +import com.njcn.oss.utils.FileStorageUtil; import com.njcn.system.enums.SystemResponseEnum; import com.njcn.system.enums.ThemeEnum; import com.njcn.system.mapper.ThemeMapper; @@ -14,6 +16,7 @@ import com.njcn.system.pojo.param.ThemeParam; import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.Theme; import com.njcn.system.service.IThemeService; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -22,6 +25,7 @@ import sun.misc.BASE64Encoder; import java.io.IOException; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** *

@@ -32,8 +36,11 @@ import java.util.Objects; * @since 2021-12-13 */ @Service +@RequiredArgsConstructor public class ThemeServiceImpl extends ServiceImpl implements IThemeService { + private final FileStorageUtil fileStorageUtil; + @Override public boolean addTheme(ThemeParam themeParam) { checkThemeParam(themeParam,false); @@ -45,6 +52,21 @@ public class ThemeServiceImpl extends ServiceImpl implements theme.setState(ThemeState.NORMAL); theme.setLogoUrl(generateBase64(themeParam.getLogoFile())); theme.setFaviconUrl(generateBase64(themeParam.getFaviconFile())); + //v3参数 + theme.setMainAnimation(themeParam.getMainAnimation()); + theme.setElementUiPrimary(String.join("", themeParam.getElementUiPrimary())); + theme.setTableHeaderBackground(String.join("", themeParam.getTableHeaderBackground())); + theme.setTableHeaderColor(String.join("", themeParam.getTableHeaderColor())); + theme.setTableCurrent(String.join("", themeParam.getTableCurrent())); + theme.setMenuBackground(String.join("", themeParam.getMenuBackground())); + theme.setMenuColor(String.join("", themeParam.getMenuColor())); + theme.setMenuActiveBackground(String.join("", themeParam.getMenuActiveBackground())); + theme.setMenuActiveColor(String.join("", themeParam.getMenuActiveColor())); + theme.setMenuTopBarBackground(String.join("", themeParam.getMenuTopBarBackground())); + theme.setHeaderBarTabColor(String.join("", themeParam.getHeaderBarTabColor())); + theme.setHeaderBarBackground(String.join("", themeParam.getHeaderBarBackground())); + theme.setLogoPath(fileStorageUtil.uploadMultipart(themeParam.getLogoFile(), OssPath.THEME)); + theme.setFaviconPath(fileStorageUtil.uploadMultipart(themeParam.getFaviconFile(), OssPath.THEME)); return this.save(theme); } @@ -55,6 +77,21 @@ public class ThemeServiceImpl extends ServiceImpl implements theme.setLogoUrl(generateBase64(themeParam.getLogoFile())); theme.setFaviconUrl(generateBase64(themeParam.getFaviconFile())); BeanUtil.copyProperties(themeParam, theme); + //v3参数 + theme.setMainAnimation(themeParam.getMainAnimation()); + theme.setElementUiPrimary(String.join("", themeParam.getElementUiPrimary())); + theme.setTableHeaderBackground(String.join("", themeParam.getTableHeaderBackground())); + theme.setTableHeaderColor(String.join("", themeParam.getTableHeaderColor())); + theme.setTableCurrent(String.join("", themeParam.getTableCurrent())); + theme.setMenuBackground(String.join("", themeParam.getMenuBackground())); + theme.setMenuColor(String.join("", themeParam.getMenuColor())); + theme.setMenuActiveBackground(String.join("", themeParam.getMenuActiveBackground())); + theme.setMenuActiveColor(String.join("", themeParam.getMenuActiveColor())); + theme.setMenuTopBarBackground(String.join("", themeParam.getMenuTopBarBackground())); + theme.setHeaderBarTabColor(String.join("", themeParam.getHeaderBarTabColor())); + theme.setHeaderBarBackground(String.join("", themeParam.getHeaderBarBackground())); + theme.setLogoPath(fileStorageUtil.uploadMultipart(themeParam.getLogoFile(), OssPath.THEME)); + theme.setFaviconPath(fileStorageUtil.uploadMultipart(themeParam.getFaviconFile(), OssPath.THEME)); return this.updateById(theme); }