小程序页面视觉对齐二期:预约图片轮播、订单数据预览、微信用户关联与请假管理
新增预约详情作品图片轮播字段与组装;新增订单预览与未关联微信用户候选接口;补齐请假记录查询接口;订单数据预览改为四列;请假管理接入真实排班例外并支持新增;日程、我的、美甲师详情与改派选择器按设计稿微调;注册结果页与申请提交时间对齐设计稿。
This commit is contained in:
+2
@@ -21,4 +21,6 @@ public interface ArtistScheduleService {
|
||||
ArtistScheduleRuleVO saveRule(ArtistScheduleRuleDTO dto);
|
||||
|
||||
ArtistScheduleExceptionVO saveException(ArtistScheduleExceptionDTO dto);
|
||||
|
||||
List<ArtistScheduleExceptionVO> listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end);
|
||||
}
|
||||
|
||||
+23
-6
@@ -112,10 +112,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
|
||||
ArtistScheduleRuleSettingVO setting = new ArtistScheduleRuleSettingVO();
|
||||
ArtistScheduleRuleDO rule = selectRule(shopId, artistId);
|
||||
setting.setRule(rule == null ? defaultRuleVO(shopId, artistId) : toRuleVO(rule));
|
||||
setting.setExceptions(listExceptions(shopId, artistId, LocalDate.now(), LocalDate.now().plusDays(GENERATED_DAYS - 1L))
|
||||
.stream()
|
||||
.map(this::toExceptionVO)
|
||||
.toList());
|
||||
setting.setExceptions(listExceptions(shopId, artistId, LocalDate.now(), LocalDate.now().plusDays(GENERATED_DAYS - 1L)));
|
||||
return setting;
|
||||
}
|
||||
|
||||
@@ -153,6 +150,26 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
|
||||
return toExceptionVO(normalized);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArtistScheduleExceptionVO> listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end) {
|
||||
LocalDate begin = start == null ? LocalDate.now().withDayOfMonth(1) : start;
|
||||
LocalDate finish = end == null ? begin.plusDays(30) : end;
|
||||
if (finish.isBefore(begin)) {
|
||||
finish = begin;
|
||||
}
|
||||
LambdaQueryWrapper<ArtistScheduleExceptionDO> wrapper = new LambdaQueryWrapper<ArtistScheduleExceptionDO>()
|
||||
.eq(ArtistScheduleExceptionDO::getShopId, shopId)
|
||||
.eq(ArtistScheduleExceptionDO::getIsDelete, 0)
|
||||
.between(ArtistScheduleExceptionDO::getWorkDate, begin, finish)
|
||||
.orderByAsc(ArtistScheduleExceptionDO::getWorkDate);
|
||||
if (artistId != null) {
|
||||
wrapper.eq(ArtistScheduleExceptionDO::getArtistId, artistId);
|
||||
}
|
||||
return exceptionMapper.selectList(wrapper).stream()
|
||||
.map(this::toExceptionVO)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private ArtistScheduleRuleDO normalizeRule(ArtistScheduleRuleDTO dto) {
|
||||
if (dto == null || dto.getShopId() == null || dto.getArtistId() == null) {
|
||||
throw new RuntimeException("排班规则信息不完整");
|
||||
@@ -220,7 +237,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
|
||||
.last("LIMIT 1"));
|
||||
}
|
||||
|
||||
private List<ArtistScheduleExceptionDO> listExceptions(Long shopId, Long artistId, LocalDate start, LocalDate end) {
|
||||
private List<ArtistScheduleExceptionDO> listExceptionRecords(Long shopId, Long artistId, LocalDate start, LocalDate end) {
|
||||
return exceptionMapper.selectList(new LambdaQueryWrapper<ArtistScheduleExceptionDO>()
|
||||
.eq(ArtistScheduleExceptionDO::getShopId, shopId)
|
||||
.eq(ArtistScheduleExceptionDO::getArtistId, artistId)
|
||||
@@ -232,7 +249,7 @@ public class ArtistScheduleServiceImpl implements ArtistScheduleService {
|
||||
private void refreshGeneratedSchedules(ArtistScheduleRuleDO rule) {
|
||||
LocalDate start = LocalDate.now();
|
||||
LocalDate end = start.plusDays(GENERATED_DAYS - 1L);
|
||||
Map<LocalDate, ArtistScheduleExceptionDO> exceptionByDate = listExceptions(rule.getShopId(), rule.getArtistId(), start, end)
|
||||
Map<LocalDate, ArtistScheduleExceptionDO> exceptionByDate = listExceptionRecords(rule.getShopId(), rule.getArtistId(), start, end)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(ArtistScheduleExceptionDO::getWorkDate, Function.identity(), (a, b) -> a));
|
||||
LocalDate cursor = start;
|
||||
|
||||
+73
@@ -15,6 +15,8 @@ import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleRuleSet
|
||||
import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleRuleVO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistScheduleVO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.manager.dto.ManagerCustomerCreateDTO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.order.service.OrderService;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.order.vo.OrderVO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentCreateDTO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentMoveDTO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.planning.dto.PlanningAppointmentStatusDTO;
|
||||
@@ -38,6 +40,7 @@ import com.xiaowang.jayucloud.salon.core.modules.privacy.vo.CustomerDialVO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.user.dto.UserDTO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.user.entity.UserDO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.user.service.UserService;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.manager.vo.UnlinkedWechatUserVO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.user.vo.UserVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -69,6 +72,7 @@ public class AdminManagerController {
|
||||
private final ShopService shopService;
|
||||
private final AdminScopeHelper adminScopeHelper;
|
||||
private final CustomerDialService customerDialService;
|
||||
private final OrderService orderService;
|
||||
|
||||
@GetMapping("/planning/calendar")
|
||||
@RequirePermission("schedule:view")
|
||||
@@ -341,6 +345,75 @@ public class AdminManagerController {
|
||||
return Result.success(artistScheduleService.saveException(dto));
|
||||
}
|
||||
|
||||
@GetMapping("/employees/schedule-exceptions")
|
||||
@RequirePermission("schedule:view")
|
||||
public Result<List<ArtistScheduleExceptionVO>> listScheduleExceptions(HttpServletRequest request,
|
||||
@RequestParam(required = false) Long artistId,
|
||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
|
||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) {
|
||||
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
|
||||
Long shopId = adminScopeHelper.resolveShopScope(currentUser, null);
|
||||
return Result.success(artistScheduleService.listExceptions(shopId, artistId, startDate, endDate));
|
||||
}
|
||||
|
||||
@GetMapping("/orders/preview")
|
||||
@RequirePermission("order:view")
|
||||
public Result<List<OrderVO>> orderPreview(HttpServletRequest request,
|
||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
|
||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) {
|
||||
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
|
||||
Long scopedShopId = adminScopeHelper.resolveShopScope(currentUser, null);
|
||||
List<OrderVO> orders = Integer.valueOf(3).equals(currentUser.getType())
|
||||
? orderService.getOrdersByArtistId(currentUser.getId())
|
||||
: orderService.getAllOrders();
|
||||
if (scopedShopId != null && !Integer.valueOf(3).equals(currentUser.getType())) {
|
||||
orders = orders.stream().filter(order -> scopedShopId.equals(order.getShopId())).toList();
|
||||
}
|
||||
if (startDate != null) {
|
||||
orders = orders.stream()
|
||||
.filter(order -> order.getCreateTime() != null && !order.getCreateTime().toLocalDate().isBefore(startDate))
|
||||
.toList();
|
||||
}
|
||||
if (endDate != null) {
|
||||
orders = orders.stream()
|
||||
.filter(order -> order.getCreateTime() != null && !order.getCreateTime().toLocalDate().isAfter(endDate))
|
||||
.toList();
|
||||
}
|
||||
List<OrderVO> preview = orders.stream()
|
||||
.sorted((left, right) -> {
|
||||
if (left.getCreateTime() == null) return 1;
|
||||
if (right.getCreateTime() == null) return -1;
|
||||
return right.getCreateTime().compareTo(left.getCreateTime());
|
||||
})
|
||||
.limit(10)
|
||||
.toList();
|
||||
return Result.success(preview);
|
||||
}
|
||||
|
||||
@GetMapping("/employees/users/unlinked-candidates")
|
||||
@RequirePermission("user:create")
|
||||
public Result<List<UnlinkedWechatUserVO>> unlinkedWechatCandidates(HttpServletRequest request,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
|
||||
Long shopId = adminScopeHelper.resolveShopScope(currentUser, null);
|
||||
java.util.Set<Long> linkedUserIds = nailArtistInfoService.getByShopId(shopId).stream()
|
||||
.map(NailArtistInfoDTO::getUserId)
|
||||
.filter(java.util.Objects::nonNull)
|
||||
.collect(java.util.stream.Collectors.toSet());
|
||||
String normalizedKeyword = keyword == null ? "" : keyword.trim().toLowerCase();
|
||||
List<UnlinkedWechatUserVO> candidates = userService.listUsersByShopId(shopId).stream()
|
||||
.filter(user -> Integer.valueOf(1).equals(user.getType()))
|
||||
.filter(user -> user.getId() != null && !linkedUserIds.contains(user.getId()))
|
||||
.filter(user -> normalizedKeyword.isEmpty()
|
||||
|| String.valueOf(user.getNickname() == null ? "" : user.getNickname()).toLowerCase().contains(normalizedKeyword)
|
||||
|| String.valueOf(user.getMaskedPhone() == null ? "" : user.getMaskedPhone()).contains(normalizedKeyword))
|
||||
.limit(50)
|
||||
.map(user -> new UnlinkedWechatUserVO(user.getId(), user.getNickname(), user.getMaskedPhone(),
|
||||
user.getAvatar(), user.getWechatId(), user.getCreateTime()))
|
||||
.toList();
|
||||
return Result.success(candidates);
|
||||
}
|
||||
|
||||
@GetMapping("/products")
|
||||
@RequirePermission("product:view")
|
||||
public Result<PageResultVO<ProductVO>> products(HttpServletRequest request,
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.xiaowang.jayucloud.salon.core.modules.manager.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class UnlinkedWechatUserVO {
|
||||
private Long id;
|
||||
private String nickname;
|
||||
private String maskedPhone;
|
||||
private String avatar;
|
||||
private String wechatId;
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
+50
@@ -34,6 +34,8 @@ import com.xiaowang.jayucloud.salon.core.modules.planning.service.PlanningServic
|
||||
import com.xiaowang.jayucloud.salon.core.modules.security.support.AdminScopeHelper;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.order.support.OrderStatus;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.file.support.ObjectStorageUrlSupport;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.file.service.ObjectStorageFileService;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.file.vo.ObjectStorageFileVO;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.planning.support.PlanningCalendarSupport;
|
||||
import com.xiaowang.jayucloud.salon.core.modules.planning.support.PlanningTodayOverviewSupport;
|
||||
import com.xiaowang.jayucloud.salon.core.support.id.TimeOrderedSnowflakeIdGenerator;
|
||||
@@ -104,6 +106,7 @@ public class PlanningServiceImpl implements PlanningService {
|
||||
private final WechatSubscribeMessageService wechatSubscribeMessageService;
|
||||
private final TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator;
|
||||
private final ObjectStorageUrlSupport objectStorageUrlSupport;
|
||||
private final ObjectStorageFileService objectStorageFileService;
|
||||
private final PhoneCrypto phoneCrypto;
|
||||
|
||||
@Override
|
||||
@@ -632,6 +635,7 @@ public class PlanningServiceImpl implements PlanningService {
|
||||
vo.setProductTitle(reservation != null && hasText(reservation.getProductTitle())
|
||||
? reservation.getProductTitle()
|
||||
: product == null ? "预约作品" : product.getTitle());
|
||||
vo.setCoverImages(resolveProductCoverImages(product));
|
||||
vo.setArtistId(artistId);
|
||||
boolean unassigned = artistId == null;
|
||||
vo.setArtistName(unassigned ? "待分配" : artist == null ? "美甲师" : artist.getName());
|
||||
@@ -993,6 +997,52 @@ public class PlanningServiceImpl implements PlanningService {
|
||||
.collect(Collectors.toMap(OrderItemDO::getId, Function.identity(), (a, b) -> a));
|
||||
}
|
||||
|
||||
private List<String> resolveProductCoverImages(ProductDO product) {
|
||||
if (product == null || !hasText(product.getImageFileIds())) {
|
||||
return List.of();
|
||||
}
|
||||
Set<Long> fileIds = new HashSet<>();
|
||||
for (String rawId : product.getImageFileIds().split(",")) {
|
||||
String normalized = rawId == null ? "" : rawId.trim();
|
||||
if (!normalized.isEmpty()) {
|
||||
try {
|
||||
fileIds.add(Long.parseLong(normalized));
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fileIds.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
Map<Long, ObjectStorageFileVO> files = objectStorageFileService.getObjectStorageFileMapByIds(fileIds);
|
||||
return parseOrderedCoverUrls(product.getImageFileIds(), files);
|
||||
}
|
||||
|
||||
private List<String> parseOrderedCoverUrls(String imageFileIds, Map<Long, ObjectStorageFileVO> files) {
|
||||
List<String> urls = new ArrayList<>();
|
||||
for (String rawId : imageFileIds.split(",")) {
|
||||
String normalized = rawId == null ? "" : rawId.trim();
|
||||
if (normalized.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
Long fileId;
|
||||
try {
|
||||
fileId = Long.parseLong(normalized);
|
||||
} catch (NumberFormatException ignored) {
|
||||
continue;
|
||||
}
|
||||
ObjectStorageFileVO file = files.get(fileId);
|
||||
if (file == null) {
|
||||
continue;
|
||||
}
|
||||
String url = objectStorageUrlSupport.toAccessibleUrl(file);
|
||||
if (hasText(url)) {
|
||||
urls.add(url);
|
||||
}
|
||||
}
|
||||
return urls;
|
||||
}
|
||||
|
||||
private Map<Long, OrderDO> loadOrders(Set<Long> orderIds) {
|
||||
if (orderIds == null || orderIds.isEmpty()) {
|
||||
return Map.of();
|
||||
|
||||
+3
@@ -3,6 +3,7 @@ package com.xiaowang.jayucloud.salon.core.modules.planning.vo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PlanningAppointmentVO {
|
||||
@@ -17,6 +18,8 @@ public class PlanningAppointmentVO {
|
||||
private Boolean customerPhoneAvailable;
|
||||
private Long productId;
|
||||
private String productTitle;
|
||||
/** 作品图片访问地址,用于预约详情项目图片轮播 */
|
||||
private List<String> coverImages;
|
||||
private Long artistId;
|
||||
private String artistName;
|
||||
private String artistColor;
|
||||
|
||||
+2
-1
@@ -574,7 +574,8 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe
|
||||
? null : contentModerationRecordMapper.selectById(application.getContentModerationRecordId());
|
||||
return new WorkbenchRegistrationStatusVO(application.getId(), application.getApplicationNo(), application.getRoleType(),
|
||||
application.getStatus(), application.getRejectReason(), application.getShopId(), application.getShopName(),
|
||||
moderation == null ? null : moderation.getStatus(), moderation == null ? null : moderation.getReason());
|
||||
moderation == null ? null : moderation.getStatus(), moderation == null ? null : moderation.getReason(),
|
||||
application.getCreateTime());
|
||||
}
|
||||
|
||||
private WorkbenchRegistrationReviewVO toReviewVO(WorkbenchRegistrationApplicationDO application, UserDO applicant,
|
||||
|
||||
+3
@@ -3,6 +3,8 @@ package com.xiaowang.jayucloud.salon.core.modules.registration.vo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class WorkbenchRegistrationStatusVO {
|
||||
@@ -15,4 +17,5 @@ public class WorkbenchRegistrationStatusVO {
|
||||
private String shopName;
|
||||
private String contentModerationStatus;
|
||||
private String contentModerationReason;
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user