保存客户资料与员工排班改造阶段成果

This commit is contained in:
2026-10-29 18:32:45 +08:00
parent 762be0d907
commit 369f58d24e
11 changed files with 152 additions and 18 deletions
@@ -41,6 +41,7 @@ import com.xiaowang.jayucloud.salon.core.modules.planning.vo.PlanningDaySummaryV
import com.xiaowang.jayucloud.salon.core.modules.planning.vo.PlanningScheduleVO;
import com.xiaowang.jayucloud.salon.core.modules.planning.vo.PlanningTodayOverviewVO;
import lombok.RequiredArgsConstructor;
import org.springframework.util.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -1,6 +1,7 @@
package com.xiaowang.jayucloud.salon.core.modules.user.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -3325,8 +3326,17 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements
private void addPhoneMatch(LambdaQueryWrapper<UserDO> wrapper, String phone) {
String hash = phoneCrypto.index(phone.trim());
List<Long> legacyIds = new ArrayList<>();
Long legacyPhoneId = userMapper.findLegacyIdByPhone(phone.trim());
if (legacyPhoneId != null) legacyIds.add(legacyPhoneId);
QueryWrapper<UserDO> legacyPhoneQuery = new QueryWrapper<>();
legacyPhoneQuery.select("id")
.eq("phone", phone.trim())
.isNull("phone_hash")
.eq("type", 0)
.eq("is_delete", 0);
for (UserDO legacyCustomer : userMapper.selectList(legacyPhoneQuery)) {
if (legacyCustomer.getId() != null && !legacyIds.contains(legacyCustomer.getId())) {
legacyIds.add(legacyCustomer.getId());
}
}
for (Long legacyContactId : userMapper.findLegacyIdsByContactPhone(phone.trim())) {
if (!legacyIds.contains(legacyContactId)) legacyIds.add(legacyContactId);
}
@@ -15,9 +15,8 @@ public final class UserProfileFieldSupport {
}
public static void requireWechatIdForServiceUser(Integer userType, String wechatId) {
if ((Integer.valueOf(2).equals(userType) || Integer.valueOf(3).equals(userType))
&& !StringUtils.hasText(wechatId)) {
throw new IllegalArgumentException("店长和美甲师的微信号不能为空");
if (Integer.valueOf(2).equals(userType) && !StringUtils.hasText(wechatId)) {
throw new IllegalArgumentException("店长的微信号不能为空");
}
}
}