From 0b75730d37e474d4cf8db86f57f0a4efe5981d1a Mon Sep 17 00:00:00 2001 From: menxipeng Date: Sun, 21 Sep 2025 17:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/back/AppVersionController.java | 123 +++++ .../back/NotificationsController.java | 11 + .../controller/back/ShopUserController.java | 2 +- .../client/ClientVersionController.java | 36 ++ .../common/core/domain/entity/AppVersion.java | 62 +++ .../core/domain/entity/ChannelEnum.java | 139 ++++++ .../core/domain/entity/Notifications.java | 6 + .../framework/config/SecurityConfig.java | 2 +- .../ruoyi/system/mapper/AppVersionMapper.java | 64 +++ .../ruoyi/system/mapper/ShopUserMapper.java | 2 + .../system/service/IAppVersionService.java | 66 +++ .../system/service/IShopUserService.java | 2 + .../service/impl/AppVersionServiceImpl.java | 109 +++++ .../service/impl/MusicInfoServiceImpl.java | 5 + .../service/impl/ShopUserServiceImpl.java | 5 + .../mapper/system/AppVersionMapper.xml | 101 ++++ .../mapper/system/NotificationsMapper.xml | 4 +- .../mapper/system/ShopUserMapper.xml | 26 + ruoyi-ui/src/api/system/version.js | 52 ++ ruoyi-ui/src/api/user/user.js | 6 +- ruoyi-ui/src/views/notifications/index.vue | 55 ++- ruoyi-ui/src/views/user/manage/index.vue | 2 +- ruoyi-ui/src/views/version/index.vue | 458 ++++++++++++++++++ 23 files changed, 1320 insertions(+), 18 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/AppVersionController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/ClientVersionController.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppVersion.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/ChannelEnum.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/AppVersionMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IAppVersionService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppVersionServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/AppVersionMapper.xml create mode 100644 ruoyi-ui/src/api/system/version.js create mode 100644 ruoyi-ui/src/views/version/index.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/AppVersionController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/AppVersionController.java new file mode 100644 index 0000000..56af944 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/AppVersionController.java @@ -0,0 +1,123 @@ +package com.ruoyi.web.controller.back; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.AppVersion; +import com.ruoyi.common.core.domain.entity.ChannelEnum; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.service.IAppVersionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 应用版本更新信息Controller + * + * @author ruoyi + * @date 2025-09-21 + */ +@RestController +@RequestMapping("/back/version") +public class AppVersionController extends BaseController +{ + @Autowired + private IAppVersionService appVersionService; + + /** + * 查询应用版本更新信息列表 + */ + @GetMapping("/list") + public TableDataInfo list(AppVersion appVersion) + { + startPage(); + List list = appVersionService.selectAppVersionList(appVersion); + return getDataTable(list); + } + + /** + * 导出应用版本更新信息列表 + */ + @PostMapping("/export") + public void export(HttpServletResponse response, AppVersion appVersion) + { + List list = appVersionService.selectAppVersionList(appVersion); + ExcelUtil util = new ExcelUtil(AppVersion.class); + util.exportExcel(response, list, "应用版本更新信息数据"); + } + + /** + * 获取应用版本更新信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:version:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(appVersionService.selectAppVersionById(id)); + } + + /** + * 新增应用版本更新信息 + */ + @PreAuthorize("@ss.hasPermi('system:version:add')") + @Log(title = "应用版本更新信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody AppVersion appVersion) + { + if (appVersionService.checkVersionByChannel(appVersion)){ + return toAjax(appVersionService.insertAppVersion(appVersion)); + } + return AjaxResult.error("当前版本code小于或等于最新版本"); + + } + + /** + * 修改应用版本更新信息 + */ + @PreAuthorize("@ss.hasPermi('system:version:edit')") + @Log(title = "应用版本更新信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody AppVersion appVersion) + { + if (appVersionService.checkVersionByChannel(appVersion)){ + return toAjax(appVersionService.updateAppVersion(appVersion)); + } + return AjaxResult.error("当前版本code小于或等于最新版本"); + } + + /** + * 删除应用版本更新信息 + */ + @PreAuthorize("@ss.hasPermi('system:version:remove')") + @Log(title = "应用版本更新信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(appVersionService.deleteAppVersionByIds(ids)); + } + + @GetMapping("/getChannel") + public AjaxResult checkVersion() { + ChannelEnum[] channelEnums = ChannelEnum.values(); + return AjaxResult.success(channelEnums); + } + + // 根据渠道获取当前最新版本 + @GetMapping("/getLastVersion") + public AjaxResult getLastVersion(@RequestParam("channel") String channel){ + return AjaxResult.success(appVersionService.getLastVersionByChannel(channel)); + } + + // 检查当前版本是否小于输入版本 + @PostMapping("/checkLastVersion") + public AjaxResult checkLastVersion(@RequestBody AppVersion appVersion){ + return AjaxResult.success(appVersionService.checkVersionByChannel(appVersion)); + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/NotificationsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/NotificationsController.java index 2427e1d..aa3a1a8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/NotificationsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/NotificationsController.java @@ -44,6 +44,17 @@ public class NotificationsController extends BaseController return getDataTable(list); } + + /** + * 获取【请填写功能名称】详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:notifications:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(notificationsService.selectNotificationsById(id)); + } + /** * 导出【请填写功能名称】列表 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/ShopUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/ShopUserController.java index 9af748e..bd5399b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/ShopUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/ShopUserController.java @@ -88,7 +88,7 @@ public class ShopUserController extends BaseController @PutMapping public AjaxResult edit(@RequestBody ShopUser shopUser) { - return toAjax(shopUserService.updateShopUser(shopUser)); + return toAjax(shopUserService.updateShopUserId(shopUser)); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/ClientVersionController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/ClientVersionController.java new file mode 100644 index 0000000..8a67f26 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/ClientVersionController.java @@ -0,0 +1,36 @@ +package com.ruoyi.web.controller.client; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.AppVersion; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.system.service.IAppVersionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 应用版本更新信息Controller + * + * @author ruoyi + * @date 2025-09-21 + */ +@RestController +@RequestMapping("/client/version") +public class ClientVersionController extends BaseController +{ + @Autowired + private IAppVersionService appVersionService; + + + // 根据渠道获取当前最新版本 + @GetMapping("/getLastVersion") + public AjaxResult getLastVersion(@RequestParam("channel") String channel){ + return AjaxResult.success(appVersionService.getLastVersionByChannel(channel)); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppVersion.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppVersion.java new file mode 100644 index 0000000..dfb929d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppVersion.java @@ -0,0 +1,62 @@ +package com.ruoyi.common.core.domain.entity; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 应用版本更新信息对象 app_version + * + * @author ruoyi + * @date 2025-09-21 + */ +@Data +public class AppVersion extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private String id; + + /** 版本代码(整数) */ + @Excel(name = "版本代码", readConverterExp = "整=数") + private Integer versionCode; + + /** 版本名称(如:1.2.0) */ + @Excel(name = "版本名称", readConverterExp = "如=:1.2.0") + private String versionName; + + /** 是否强制更新:0-否,1-是 */ + @Excel(name = "是否强制更新:0-否,1-是") + private Integer isForce; + + /** 渠道标识(如:yingyongbao, honor, xiaomi) */ + @Excel(name = "渠道标识", readConverterExp = "如=:yingyongbao,,h=onor,,x=iaomi") + private String channel; + + /** APK下载地址 */ + @Excel(name = "APK下载地址") + private String downloadUrl; + + /** 更新日志 */ + @Excel(name = "更新日志") + private String updateLog; + + /** 安装包大小(如:15.2MB) */ + @Excel(name = "安装包大小", readConverterExp = "如=:15.2MB") + private String size; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/ChannelEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/ChannelEnum.java new file mode 100644 index 0000000..ac5015a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/ChannelEnum.java @@ -0,0 +1,139 @@ +package com.ruoyi.common.core.domain.entity; + +/** + * 应用渠道枚举 + */ +public enum ChannelEnum { + + /** + * 官方渠道 + */ + OFFICIAL("official", "官方渠道"), + + /** + * 小米应用商店 + */ + XIAOMI("xiaomi", "小米应用商店"), + + /** + * 华为应用市场 + */ + HUAWEI("huawei", "华为应用市场"), + + /** + * OPPO应用商店 + */ + OPPO("oppo", "OPPO应用商店"), + + /** + * vivo应用商店 + */ + VIVO("vivo", "vivo应用商店"), + + /** + * 魅族应用商店 + */ + MEIZU("meizu", "魅族应用商店"), + + /** + * 荣耀应用市场 + */ + HONOR("honor", "荣耀应用市场"), + + /** + * 应用宝 + */ + YINGYONGBAO("yingyongbao", "应用宝"), + + /** + * iOS App Store + */ + IOS("ios", "iOS App Store"); + + /** + * 渠道编码 + */ + private final String code; + + /** + * 渠道描述 + */ + private final String description; + + ChannelEnum(String code, String description) { + this.code = code; + this.description = description; + } + + public String getCode() { + return code; + } + + public String getDescription() { + return description; + } + + /** + * 根据渠道编码获取枚举 + * + * @param code 渠道编码 + * @return 对应的枚举,如果找不到返回null + */ + public static ChannelEnum getByCode(String code) { + if (code == null || code.trim().isEmpty()) { + return null; + } + for (ChannelEnum channel : values()) { + if (channel.code.equalsIgnoreCase(code.trim())) { + return channel; + } + } + return null; + } + + /** + * 检查渠道编码是否存在 + * + * @param code 渠道编码 + * @return 是否存在 + */ + public static boolean contains(String code) { + return getByCode(code) != null; + } + + /** + * 获取所有渠道编码数组 + * + * @return 渠道编码数组 + */ + public static String[] getAllCodes() { + ChannelEnum[] values = values(); + String[] codes = new String[values.length]; + for (int i = 0; i < values.length; i++) { + codes[i] = values[i].code; + } + return codes; + } + + /** + * 获取所有渠道描述数组 + * + * @return 渠道描述数组 + */ + public static String[] getAllDescriptions() { + ChannelEnum[] values = values(); + String[] descriptions = new String[values.length]; + for (int i = 0; i < values.length; i++) { + descriptions[i] = values[i].description; + } + return descriptions; + } + + @Override + public String toString() { + return "ChannelEnum{" + + "code='" + code + '\'' + + ", description='" + description + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Notifications.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Notifications.java index f6c82a5..96f1b5b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Notifications.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/Notifications.java @@ -51,6 +51,12 @@ public class Notifications extends BaseEntity @Excel(name = "计划发送时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date sendTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date findStart; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date findEnd; + private List shopUsers; } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index ecb82fc..80a6c30 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -131,7 +131,7 @@ public class SecurityConfig permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); // 对于登录login 注册register 验证码captchaImage 允许匿名访问 //"/client/**","/back/**" - requests.antMatchers("/login", "/register","/client/shopLogin","/file/download/**", "/captchaImage","/client/getCode").permitAll() + requests.antMatchers("/login", "/register","/client/shopLogin","/file/download/**", "/captchaImage","/client/getCode","/back/**").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/AppVersionMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/AppVersionMapper.java new file mode 100644 index 0000000..0669cf7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/AppVersionMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.common.core.domain.entity.AppVersion; + +import java.util.List; + +/** + * 应用版本更新信息Mapper接口 + * + * @author ruoyi + * @date 2025-09-21 + */ +public interface AppVersionMapper +{ + /** + * 查询应用版本更新信息 + * + * @param id 应用版本更新信息主键 + * @return 应用版本更新信息 + */ + public AppVersion selectAppVersionById(String id); + + /** + * 查询应用版本更新信息列表 + * + * @param appVersion 应用版本更新信息 + * @return 应用版本更新信息集合 + */ + public List selectAppVersionList(AppVersion appVersion); + + /** + * 新增应用版本更新信息 + * + * @param appVersion 应用版本更新信息 + * @return 结果 + */ + public int insertAppVersion(AppVersion appVersion); + + /** + * 修改应用版本更新信息 + * + * @param appVersion 应用版本更新信息 + * @return 结果 + */ + public int updateAppVersion(AppVersion appVersion); + + /** + * 删除应用版本更新信息 + * + * @param id 应用版本更新信息主键 + * @return 结果 + */ + public int deleteAppVersionById(String id); + + /** + * 批量删除应用版本更新信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAppVersionByIds(String[] ids); + + AppVersion selectLastVersionByChannel(String channel); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ShopUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ShopUserMapper.java index 31980ad..2e1e549 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ShopUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ShopUserMapper.java @@ -87,4 +87,6 @@ public interface ShopUserMapper { public List selectUserMusicTags(String userId); List selectPhoneShopUserByUserIds(List userIds); + + int updateShopUserId(ShopUser shopUser); } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IAppVersionService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IAppVersionService.java new file mode 100644 index 0000000..b4b4c06 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IAppVersionService.java @@ -0,0 +1,66 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.domain.entity.AppVersion; + +import java.util.List; + +/** + * 应用版本更新信息Service接口 + * + * @author ruoyi + * @date 2025-09-21 + */ +public interface IAppVersionService +{ + /** + * 查询应用版本更新信息 + * + * @param id 应用版本更新信息主键 + * @return 应用版本更新信息 + */ + public AppVersion selectAppVersionById(String id); + + /** + * 查询应用版本更新信息列表 + * + * @param appVersion 应用版本更新信息 + * @return 应用版本更新信息集合 + */ + public List selectAppVersionList(AppVersion appVersion); + + /** + * 新增应用版本更新信息 + * + * @param appVersion 应用版本更新信息 + * @return 结果 + */ + public int insertAppVersion(AppVersion appVersion); + + /** + * 修改应用版本更新信息 + * + * @param appVersion 应用版本更新信息 + * @return 结果 + */ + public int updateAppVersion(AppVersion appVersion); + + /** + * 批量删除应用版本更新信息 + * + * @param ids 需要删除的应用版本更新信息主键集合 + * @return 结果 + */ + public int deleteAppVersionByIds(String[] ids); + + /** + * 删除应用版本更新信息信息 + * + * @param id 应用版本更新信息主键 + * @return 结果 + */ + public int deleteAppVersionById(String id); + + AppVersion getLastVersionByChannel(String channel); + + boolean checkVersionByChannel(AppVersion appVersion); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IShopUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IShopUserService.java index 92a336d..c256446 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IShopUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IShopUserService.java @@ -85,4 +85,6 @@ public interface IShopUserService * @return 用户标签列表(以分号分隔的字符串) */ public String getUserTags(String userId); + + int updateShopUserId(ShopUser shopUser); } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppVersionServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppVersionServiceImpl.java new file mode 100644 index 0000000..859d6b4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppVersionServiceImpl.java @@ -0,0 +1,109 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.common.core.domain.entity.AppVersion; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.mapper.AppVersionMapper; +import com.ruoyi.system.service.IAppVersionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 应用版本更新信息Service业务层处理 + * + * @author ruoyi + * @date 2025-09-21 + */ +@Service +public class AppVersionServiceImpl implements IAppVersionService +{ + @Autowired + private AppVersionMapper appVersionMapper; + + /** + * 查询应用版本更新信息 + * + * @param id 应用版本更新信息主键 + * @return 应用版本更新信息 + */ + @Override + public AppVersion selectAppVersionById(String id) + { + return appVersionMapper.selectAppVersionById(id); + } + + /** + * 查询应用版本更新信息列表 + * + * @param appVersion 应用版本更新信息 + * @return 应用版本更新信息 + */ + @Override + public List selectAppVersionList(AppVersion appVersion) + { + return appVersionMapper.selectAppVersionList(appVersion); + } + + /** + * 新增应用版本更新信息 + * + * @param appVersion 应用版本更新信息 + * @return 结果 + */ + @Override + public int insertAppVersion(AppVersion appVersion) + { + + appVersion.setCreateTime(DateUtils.getNowDate()); + return appVersionMapper.insertAppVersion(appVersion); + } + + /** + * 修改应用版本更新信息 + * + * @param appVersion 应用版本更新信息 + * @return 结果 + */ + @Override + public int updateAppVersion(AppVersion appVersion) + { + appVersion.setUpdateTime(DateUtils.getNowDate()); + return appVersionMapper.updateAppVersion(appVersion); + } + + /** + * 批量删除应用版本更新信息 + * + * @param ids 需要删除的应用版本更新信息主键 + * @return 结果 + */ + @Override + public int deleteAppVersionByIds(String[] ids) + { + return appVersionMapper.deleteAppVersionByIds(ids); + } + + /** + * 删除应用版本更新信息信息 + * + * @param id 应用版本更新信息主键 + * @return 结果 + */ + @Override + public int deleteAppVersionById(String id) + { + return appVersionMapper.deleteAppVersionById(id); + } + + @Override + public AppVersion getLastVersionByChannel(String channel) { + return appVersionMapper.selectLastVersionByChannel(channel); + } + + @Override + public boolean checkVersionByChannel(AppVersion appVersion) { + AppVersion lastAppVersion = appVersionMapper.selectLastVersionByChannel(appVersion.getChannel()); + return appVersion.getVersionCode() > lastAppVersion.getVersionCode(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicInfoServiceImpl.java index 1feabe7..15bf8c0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service.impl; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.enums.MusicType; @@ -210,11 +211,15 @@ public class MusicInfoServiceImpl implements IMusicInfoService //String musicId = String.valueOf(param.getMusicId()); String sceneIds = param.getSceneIds(); String sceneJson = param.getSceneJson(); + String userName = SecurityUtils.getUsername(); // 新增混音音乐标签 //MusicInfo musicInfo = musicInfoMapper.selectByMusicId(musicId); //if (musicInfo != null){ long newMusicId = IdUtil.getSnowflakeNextId(); param.setMusicId(newMusicId); + if (param.getName() == null || (param.getName()).isEmpty()){ + param.setName(userName + DateUtil.current()); + } param.setMusicType(MusicType.MIXING.getMusicType()); //param.setMusicAddr(musicInfo.getMusicAddr()); musicInfoMapper.insertMusicInfo(param); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ShopUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ShopUserServiceImpl.java index b4f928f..af5408e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ShopUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ShopUserServiceImpl.java @@ -202,4 +202,9 @@ public class ShopUserServiceImpl implements IShopUserService return tags.toString(); } + + @Override + public int updateShopUserId(ShopUser shopUser) { + return shopUserMapper.updateShopUserId(shopUser); + } } \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/AppVersionMapper.xml b/ruoyi-system/src/main/resources/mapper/system/AppVersionMapper.xml new file mode 100644 index 0000000..46f55df --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/AppVersionMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + select id, version_code, version_name, is_force, channel, download_url, update_log, size, create_time, update_time from app_version + + + + + + + + insert into app_version + + version_code, + version_name, + is_force, + channel, + download_url, + update_log, + size, + create_time, + update_time, + + + #{versionCode}, + #{versionName}, + #{isForce}, + #{channel}, + #{downloadUrl}, + #{updateLog}, + #{size}, + #{createTime}, + #{updateTime}, + + + + + update app_version + + version_code = #{versionCode}, + version_name = #{versionName}, + is_force = #{isForce}, + channel = #{channel}, + download_url = #{downloadUrl}, + update_log = #{updateLog}, + size = #{size}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from app_version where id = #{id} + + + + delete from app_version where id in + + #{id} + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/NotificationsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/NotificationsMapper.xml index bd7d4c3..9083bd5 100644 --- a/ruoyi-system/src/main/resources/mapper/system/NotificationsMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/NotificationsMapper.xml @@ -29,7 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and extra_data = #{extraData} and creator = #{creator} and updated_time = #{updatedTime} - and send_time = #{sendTime} + and send_time >= #{findStart} + and send_time <= #{findEnd} + diff --git a/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml index 6a9c88b..e80e940 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml @@ -230,4 +230,30 @@ #{userId} + + + update shop_user + + user_id = #{userId}, + username = #{username}, + password = #{password}, + phone = #{phone}, + nickname = #{nickname}, + sex = #{sex}, + head_img = #{headImg}, + birthday = #{birthday}, + addr = #{addr}, + register_time = #{registerTime}, + status = #{status}, + vip = #{vip}, + online = #{online}, + create_time = #{createTime}, + update_time = #{updateTime}, + is_del = #{isDel}, + vip_start_time = #{vipStartTime}, + vip_end_time = #{vipEndTime}, + descinfo = #{descinfo}, + + where shop_user.id = #{id} + \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/version.js b/ruoyi-ui/src/api/system/version.js new file mode 100644 index 0000000..01b46cb --- /dev/null +++ b/ruoyi-ui/src/api/system/version.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询应用版本更新信息列表 +export function listVersion(query) { + return request({ + url: '/back/version/list', + method: 'get', + params: query + }) +} + +// 查询应用版本更新信息详细 +export function getVersion(id) { + return request({ + url: '/back/version/' + id, + method: 'get' + }) +} + +// 新增应用版本更新信息 +export function addVersion(data) { + return request({ + url: '/back/version', + method: 'post', + data: data + }) +} + +// 修改应用版本更新信息 +export function updateVersion(data) { + return request({ + url: '/back/version', + method: 'put', + data: data + }) +} + +// 删除应用版本更新信息 +export function delVersion(id) { + return request({ + url: '/back/version/' + id, + method: 'delete' + }) +} + +// 获取渠道列表 +export function getChannelList() { + return request({ + url: '/back/version/getChannel', + method: 'get' + }) +} diff --git a/ruoyi-ui/src/api/user/user.js b/ruoyi-ui/src/api/user/user.js index 1db7b96..1a847f6 100644 --- a/ruoyi-ui/src/api/user/user.js +++ b/ruoyi-ui/src/api/user/user.js @@ -20,8 +20,8 @@ export function getUser(id) { // 修改用户状态 export function updateUserStatus(id, status) { return request({ - url: '/back/user/status', - method: 'post', + url: '/back/user/', + method: 'put', data: { id: id, status: status @@ -35,7 +35,7 @@ export function delUser(id) { url: '/back/user/' + id, method: 'delete' }) -} +} // 获取用户标签 export function getUserTags(userId) { diff --git a/ruoyi-ui/src/views/notifications/index.vue b/ruoyi-ui/src/views/notifications/index.vue index e5ecf2d..6a15c32 100644 --- a/ruoyi-ui/src/views/notifications/index.vue +++ b/ruoyi-ui/src/views/notifications/index.vue @@ -14,13 +14,15 @@ - + + value-format="yyyy-MM-dd HH:mm:ss"> @@ -306,7 +308,9 @@ export default { content: null, notificationType: null, creator: null, - sendTime: null + sendTime: null, + findStart: null, + findEnd: null }, // 表单参数 form: {}, @@ -334,7 +338,11 @@ export default { /** 查询【请填写功能名称】列表 */ getList() { this.loading = true - listNotifications(this.queryParams).then(response => { + // 创建查询参数副本,排除sendTime参数 + const params = { ...this.queryParams } + delete params.sendTime + + listNotifications(params).then(response => { this.notificationsList = response.rows this.total = parseInt(response.total) || 0 this.loading = false @@ -359,6 +367,15 @@ export default { }, /** 搜索按钮操作 */ handleQuery() { + // 处理时间段参数 + if (this.queryParams.sendTime && this.queryParams.sendTime.length === 2) { + this.queryParams.findStart = this.queryParams.sendTime[0] + this.queryParams.findEnd = this.queryParams.sendTime[1] + } else { + this.queryParams.findStart = null + this.queryParams.findEnd = null + } + this.queryParams.pageNum = 1 this.getList() }, @@ -412,7 +429,23 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const ids = row.id || this.ids - this.$modal.confirm('是否确认删除通知编号为"' + ids + '"的数据项?').then(function() { + let confirmMessage = '' + + if (row && row.title) { + // 单个删除,显示通知标题 + confirmMessage = `是否确认删除通知"${row.title}"?` + } else { + // 批量删除,显示选中的通知标题 + const selectedNotifications = this.notificationsList.filter(item => this.ids.includes(item.id)) + if (selectedNotifications.length === 1) { + confirmMessage = `是否确认删除通知"${selectedNotifications[0].title}"?` + } else { + const titles = selectedNotifications.map(item => item.title).join('、') + confirmMessage = `是否确认删除以下通知:${titles}?` + } + } + + this.$modal.confirm(confirmMessage).then(function() { return delNotifications(ids) }).then(() => { this.getList() @@ -445,11 +478,11 @@ export default { getBindUsers(id).then(response => { if (response.data && response.data.length > 0) { console.log("已绑定用户列表:", response.data); - + // 将用户ID转换为字符串类型,确保类型一致 const bindUserIds = response.data.map(user => String(user.userId)); this.userIds = bindUserIds; - + console.log("转换后的用户ID列表:", bindUserIds); // 延迟执行,确保表格已经完全渲染 @@ -457,13 +490,13 @@ export default { // 先清除所有选中状态 if (this.$refs.userTable) { this.$refs.userTable.clearSelection(); - + // 为已绑定的用户设置选中状态 this.userList.forEach(row => { // 确保类型一致,都转换为字符串进行比较 const rowUserId = String(row.userId); console.log("比较用户ID:", rowUserId, "是否在列表中:", bindUserIds.includes(rowUserId)); - + if (bindUserIds.includes(rowUserId)) { console.log("选中用户:", row); this.$refs.userTable.toggleRowSelection(row, true); diff --git a/ruoyi-ui/src/views/user/manage/index.vue b/ruoyi-ui/src/views/user/manage/index.vue index b47f5d5..8a218ec 100644 --- a/ruoyi-ui/src/views/user/manage/index.vue +++ b/ruoyi-ui/src/views/user/manage/index.vue @@ -166,7 +166,7 @@ export default { const statusText = row.status === '1' ? "加入黑名单" : "取消加入黑名单"; const newStatus = row.status === '1' ? '2' : '1'; - this.$modal.confirm('确认要' + statusText + '用户"' + row.nickname + '"吗?').then(function() { + this.$modal.confirm('确认要' + statusText + '用户"' + row.phone + '"吗?').then(function() { return updateUserStatus(row.id, newStatus); }).then(() => { this.getList(); diff --git a/ruoyi-ui/src/views/version/index.vue b/ruoyi-ui/src/views/version/index.vue new file mode 100644 index 0000000..ee2aa1c --- /dev/null +++ b/ruoyi-ui/src/views/version/index.vue @@ -0,0 +1,458 @@ + + +