修复bug

This commit is contained in:
menxipeng
2025-09-21 17:49:23 +08:00
parent 142c00bc9e
commit 0b75730d37
23 changed files with 1320 additions and 18 deletions

View File

@@ -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<AppVersion> 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);
}

View File

@@ -87,4 +87,6 @@ public interface ShopUserMapper {
public List<String> selectUserMusicTags(String userId);
List<String> selectPhoneShopUserByUserIds(List<Long> userIds);
int updateShopUserId(ShopUser shopUser);
}

View File

@@ -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<AppVersion> 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);
}

View File

@@ -85,4 +85,6 @@ public interface IShopUserService
* @return 用户标签列表(以分号分隔的字符串)
*/
public String getUserTags(String userId);
int updateShopUserId(ShopUser shopUser);
}

View File

@@ -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<AppVersion> 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();
}
}

View File

@@ -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);

View File

@@ -202,4 +202,9 @@ public class ShopUserServiceImpl implements IShopUserService
return tags.toString();
}
@Override
public int updateShopUserId(ShopUser shopUser) {
return shopUserMapper.updateShopUserId(shopUser);
}
}

View File

@@ -0,0 +1,101 @@
<?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.AppVersionMapper">
<resultMap type="AppVersion" id="AppVersionResult">
<result property="id" column="id" />
<result property="versionCode" column="version_code" />
<result property="versionName" column="version_name" />
<result property="isForce" column="is_force" />
<result property="channel" column="channel" />
<result property="downloadUrl" column="download_url" />
<result property="updateLog" column="update_log" />
<result property="size" column="size" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectAppVersionVo">
select id, version_code, version_name, is_force, channel, download_url, update_log, size, create_time, update_time from app_version
</sql>
<select id="selectAppVersionList" parameterType="AppVersion" resultMap="AppVersionResult">
<include refid="selectAppVersionVo"/>
<where>
<if test="versionCode != null and versionCode != ''"> and version_code = #{versionCode}</if>
<if test="versionName != null and versionName != ''"> and version_name like concat('%', #{versionName}, '%')</if>
<if test="isForce != null "> and is_force = #{isForce}</if>
<if test="channel != null and channel != ''"> and channel = #{channel}</if>
<if test="downloadUrl != null and downloadUrl != ''"> and download_url = #{downloadUrl}</if>
<if test="updateLog != null and updateLog != ''"> and update_log = #{updateLog}</if>
<if test="size != null and size != ''"> and size = #{size}</if>
</where>
</select>
<select id="selectAppVersionById" parameterType="String" resultMap="AppVersionResult">
<include refid="selectAppVersionVo"/>
where id = #{id}
</select>
<insert id="insertAppVersion" parameterType="AppVersion" useGeneratedKeys="true" keyProperty="id">
insert into app_version
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="versionCode != null and versionCode != ''">version_code,</if>
<if test="versionName != null and versionName != ''">version_name,</if>
<if test="isForce != null">is_force,</if>
<if test="channel != null and channel != ''">channel,</if>
<if test="downloadUrl != null and downloadUrl != ''">download_url,</if>
<if test="updateLog != null">update_log,</if>
<if test="size != null">size,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="versionCode != null and versionCode != ''">#{versionCode},</if>
<if test="versionName != null and versionName != ''">#{versionName},</if>
<if test="isForce != null">#{isForce},</if>
<if test="channel != null and channel != ''">#{channel},</if>
<if test="downloadUrl != null and downloadUrl != ''">#{downloadUrl},</if>
<if test="updateLog != null">#{updateLog},</if>
<if test="size != null">#{size},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateAppVersion" parameterType="AppVersion">
update app_version
<trim prefix="SET" suffixOverrides=",">
<if test="versionCode != null and versionCode != ''">version_code = #{versionCode},</if>
<if test="versionName != null and versionName != ''">version_name = #{versionName},</if>
<if test="isForce != null">is_force = #{isForce},</if>
<if test="channel != null and channel != ''">channel = #{channel},</if>
<if test="downloadUrl != null and downloadUrl != ''">download_url = #{downloadUrl},</if>
<if test="updateLog != null">update_log = #{updateLog},</if>
<if test="size != null">size = #{size},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppVersionById" parameterType="String">
delete from app_version where id = #{id}
</delete>
<delete id="deleteAppVersionByIds" parameterType="String">
delete from app_version where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectLastVersionByChannel" resultMap="AppVersionResult">
SELECT * FROM app_version
WHERE channel = #{channel}
ORDER BY version_code DESC
LIMIT 1;
</select>
</mapper>

View File

@@ -29,7 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="extraData != null and extraData != ''"> and extra_data = #{extraData}</if>
<if test="creator != null and creator != ''"> and creator = #{creator}</if>
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
<if test="sendTime != null "> and send_time = #{sendTime}</if>
<if test="findStart != null "> and send_time >= #{findStart}</if>
<if test="findEnd != null "> and send_time &lt;= #{findEnd}</if>
</where>
</select>

View File

@@ -230,4 +230,30 @@
#{userId}
</foreach>
</select>
<update id="updateShopUserId">
update shop_user
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="username != null">username = #{username},</if>
<if test="password != null">password = #{password},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="nickname != null">nickname = #{nickname},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="headImg != null">head_img = #{headImg},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="addr != null">addr = #{addr},</if>
<if test="registerTime != null">register_time = #{registerTime},</if>
<if test="status != null">status = #{status},</if>
<if test="vip != null">vip = #{vip},</if>
<if test="online != null">online = #{online},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="vipStartTime != null"> vip_start_time = #{vipStartTime},</if>
<if test="vipEndTime != null"> vip_end_time = #{vipEndTime},</if>
<if test="descinfo != null"> descinfo = #{descinfo},</if>
</trim>
where shop_user.id = #{id}
</update>
</mapper>