工单信息修正、小程序登录修正

This commit is contained in:
2025-12-28 14:58:09 +08:00
parent 7eddf00705
commit 8448a801ce
11 changed files with 62 additions and 27 deletions

View File

@@ -12,7 +12,7 @@ INSERT INTO sys.tb_sys_user (
) VALUES
('USER-0001', 'user_admin', 'admin',
'$2a$10$XAe0TE2p0ym94bKJ8LJ52el3M4oYyiExVH/kNCh.pWLLGDZWNM9Yu', -- admin123
'admin@urbanlifeline.com', '13800138000', '7503bbfc6171077b737cdc4f76e781893a9a474c9ead05b6b946ac936e5a0288',
'admin@urbanlifeline.com', 'DAWTIvnCQI/KmtwkBYI5WP2NpnSKTq4kStJpOJKahOeJLNhAQ0s1', '7503bbfc6171077b737cdc4f76e781893a9a474c9ead05b6b946ac936e5a0288',
now(), 0, false);
-- 超级管理员用户信息
@@ -43,7 +43,7 @@ INSERT INTO sys.tb_sys_user (
) VALUES
('USER-0002', 'user_demo', 'demo',
'$2a$10$XAe0TE2p0ym94bKJ8LJ52el3M4oYyiExVH/kNCh.pWLLGDZWNM9Yu', -- admin123
'demo@urbanlifeline.com', '13800138001', '4e98ffd0e02a7f746291bff77c6c497225e8884758d503bde2efad64e45ad44b',
'demo@urbanlifeline.com', 'Y9tsAZOppzsxmKvI7iqqRBMDHzvWym2DE5FX1KgEGVBC5Ii1UG68', '4e98ffd0e02a7f746291bff77c6c497225e8884758d503bde2efad64e45ad44b',
now(), 0, false);
-- 示例用户信息

View File

@@ -224,7 +224,7 @@ public class AesEncryptUtil {
public static void main(String[] args) {
AesEncryptUtil aesEncryptUtil = new AesEncryptUtil("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=");
String phone = "17857100375";
String phone = "17857100376";
// 测试加密(每次都不同,不能用于查询)
String encryptedPhone1 = aesEncryptUtil.encryptPhone(phone);

View File

@@ -44,8 +44,15 @@ public class FileController {
public ResultDomain<TbSysFileDTO> uploadFile(
@RequestParam("file") MultipartFile file,
@RequestParam(value = "module", required = false) String module,
@RequestParam(value = "businessId", required = false) String businessId) {
return fileService.uploadFile(file, module, businessId);
@RequestParam(value = "businessId", required = false) String businessId,
@RequestParam(value = "fileName", required = false) String fileName) {
try {
// 如果前端传递了 fileName使用它否则使用 MultipartFile 的原始文件名
String actualFileName = (fileName != null && !fileName.isEmpty()) ? fileName : file.getOriginalFilename();
return fileService.uploadFileBytes(file.getBytes(), actualFileName, file.getContentType(), module, businessId);
} catch (Exception e) {
return ResultDomain.failure("文件上传失败: " + e.getMessage());
}
}
@Operation(summary = "批量上传文件")

View File

@@ -226,9 +226,15 @@ public class SysUserServiceImpl implements SysUserService {
public ResultDomain<SysUserVO> getLoginUser(SysUserVO filter) {
// 登录查询语义与 getUser 相同(可根据用户名/手机号/邮箱/wechatId查询
if(NonUtils.isNotNull(filter.getPhone())){
// 确保 phoneHash 被正确设置
filter.setPhone(filter.getPhone());
logger.info("登录查询 - phone: {}, phoneHash: {}", filter.getPhone(), filter.getPhoneHash());
}
if(NonUtils.isNotNull(filter.getWechatId())){
logger.info("登录查询 - wechatId: {}", filter.getWechatId());
}
List<SysUserVO> list = userMapper.getUserByFilter(filter);
logger.info("登录查询结果数量: {}", list != null ? list.size() : 0);
if (list == null || list.isEmpty()) {
return ResultDomain.failure("用户不存在");
}

View File

@@ -63,7 +63,7 @@
password,
<!-- 可空/有默认值字段:按是否有入参动态拼接 -->
<if test="email != null and email != ''">email,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="phone != null and phone != ''">phone, phone_hash,</if>
<if test="wechatId != null and wechatId != ''">wechat_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
@@ -79,7 +79,7 @@
#{password},
<!-- 可空/有默认值字段对应的值 -->
<if test="email != null and email != ''">#{email},</if>
<if test="phone != null and phone != ''">#{phone, typeHandler=org.xyzh.common.jdbc.handler.EncryptedStringTypeHandler},</if>
<if test="phone != null and phone != ''">#{phone, typeHandler=org.xyzh.common.jdbc.handler.EncryptedStringTypeHandler}, #{phoneHash},</if>
<if test="wechatId != null and wechatId != ''">#{wechatId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
@@ -93,9 +93,6 @@
<update id="updateUser" parameterType="org.xyzh.common.dto.sys.TbSysUserDTO">
UPDATE sys.tb_sys_user
<set>
<if test="username != null and username != ''">
username = #{username},
</if>
<if test="password != null and password != ''">
password = #{password},
</if>
@@ -104,6 +101,7 @@
</if>
<if test="phone != null and phone != ''">
phone = #{phone, typeHandler=org.xyzh.common.jdbc.handler.EncryptedStringTypeHandler},
phone_hash = #{phoneHash},
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id = #{wechatId},

View File

@@ -29,6 +29,7 @@ import org.xyzh.api.workcase.vo.CustomerServiceVO;
import org.xyzh.api.workcase.vo.VideoMeetingVO;
import org.xyzh.common.auth.utils.JwtTokenUtil;
import org.xyzh.common.auth.utils.LoginUtil;
import org.xyzh.common.core.domain.LoginDomain;
import org.xyzh.common.core.domain.ResultDomain;
import org.xyzh.common.core.page.PageRequest;
import org.xyzh.common.utils.validation.ValidationParam;
@@ -128,8 +129,11 @@ public class WorkcaseChatContorller {
return ResultDomain.failure(vr.getAllErrors());
}
String userId = LoginUtil.getCurrentUserId();
LoginDomain loginDomain = LoginUtil.getCurrentLogin();
String userId = loginDomain.getUser().getUserId();
if("guest".equals(loginDomain.getUser().getStatus())){
pageRequest.getFilter().setGuestId(userId);
}
return chatRoomService.getChatRoomPage(pageRequest, userId);
}

View File

@@ -14,6 +14,8 @@ import org.xyzh.api.workcase.dto.TbWorkcaseDTO;
import org.xyzh.api.workcase.dto.TbWorkcaseDeviceDTO;
import org.xyzh.api.workcase.dto.TbWorkcaseProcessDTO;
import org.xyzh.api.workcase.service.WorkcaseService;
import org.xyzh.common.auth.utils.LoginUtil;
import org.xyzh.common.core.domain.LoginDomain;
import org.xyzh.common.core.domain.ResultDomain;
import org.xyzh.common.core.page.PageRequest;
import org.xyzh.common.utils.validation.ValidationResult;
@@ -91,6 +93,10 @@ public class WorkcaseController {
@PreAuthorize("hasAuthority('workcase:ticket:view')")
@PostMapping("/list")
public ResultDomain<TbWorkcaseDTO> getWorkcaseList(@RequestBody TbWorkcaseDTO filter) {
LoginDomain loginDomain = LoginUtil.getCurrentLogin();
if ("guest".equals(loginDomain.getUser().getStatus())) {
filter.setUserId(loginDomain.getUser().getUserId());
}
return workcaseService.getWorkcaseList(filter);
}