|
@@ -18,7 +18,14 @@ import shop.alien.entity.store.dto.StoreStaffFitnessCourseGroup;
|
|
|
import shop.alien.entity.store.dto.StoreStaffFitnessCourseItem;
|
|
import shop.alien.entity.store.dto.StoreStaffFitnessCourseItem;
|
|
|
import shop.alien.entity.store.excelVo.StoreStaffConfigExcelVo;
|
|
import shop.alien.entity.store.excelVo.StoreStaffConfigExcelVo;
|
|
|
import shop.alien.entity.store.excelVo.util.ExcelGenerator;
|
|
import shop.alien.entity.store.excelVo.util.ExcelGenerator;
|
|
|
|
|
+import shop.alien.entity.result.R;
|
|
|
|
|
+import shop.alien.entity.store.StoreStaffFitnessBase;
|
|
|
|
|
+import shop.alien.entity.store.StoreStaffFitnessCertification;
|
|
|
|
|
+import shop.alien.entity.store.StoreStaffFitnessCourse;
|
|
|
|
|
+import shop.alien.entity.store.StoreStaffFitnessExperience;
|
|
|
|
|
+import shop.alien.entity.store.vo.PerformanceScheduleVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffDetailVo;
|
|
import shop.alien.entity.store.vo.StoreStaffDetailVo;
|
|
|
|
|
+import shop.alien.entity.store.vo.StoreStaffDetailWithPerformanceVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
|
|
import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffPositionCountVo;
|
|
import shop.alien.entity.store.vo.StoreStaffPositionCountVo;
|
|
|
import shop.alien.mapper.*;
|
|
import shop.alien.mapper.*;
|
|
@@ -29,6 +36,7 @@ import shop.alien.store.service.StoreStaffFitnessCourseService;
|
|
|
import shop.alien.store.service.StoreStaffFitnessExperienceService;
|
|
import shop.alien.store.service.StoreStaffFitnessExperienceService;
|
|
|
import shop.alien.store.util.CommonConstant;
|
|
import shop.alien.store.util.CommonConstant;
|
|
|
import shop.alien.store.util.ai.AiContentModerationUtil;
|
|
import shop.alien.store.util.ai.AiContentModerationUtil;
|
|
|
|
|
+import shop.alien.store.util.ai.AiVideoModerationUtil;
|
|
|
import shop.alien.util.ali.AliOSSUtil;
|
|
import shop.alien.util.ali.AliOSSUtil;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -75,7 +83,7 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
|
|
|
|
|
private final AiContentModerationUtil aiContentModerationUtil;
|
|
private final AiContentModerationUtil aiContentModerationUtil;
|
|
|
|
|
|
|
|
- private final shop.alien.store.util.ai.AiVideoModerationUtil aiVideoModerationUtil;
|
|
|
|
|
|
|
+ private final AiVideoModerationUtil aiVideoModerationUtil;
|
|
|
|
|
|
|
|
private final BarPerformanceMapper barPerformanceMapper;
|
|
private final BarPerformanceMapper barPerformanceMapper;
|
|
|
|
|
|
|
@@ -221,7 +229,7 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// 2. 审核视频(如果有)
|
|
// 2. 审核视频(如果有)
|
|
|
- shop.alien.store.util.ai.AiVideoModerationUtil.VideoAuditResult videoAuditResult = null;
|
|
|
|
|
|
|
+ AiVideoModerationUtil.VideoAuditResult videoAuditResult = null;
|
|
|
if (!videoUrls.isEmpty()) {
|
|
if (!videoUrls.isEmpty()) {
|
|
|
log.info("开始审核视频,视频数量:{}", videoUrls.size());
|
|
log.info("开始审核视频,视频数量:{}", videoUrls.size());
|
|
|
videoAuditResult = aiVideoModerationUtil.auditVideos(videoUrls);
|
|
videoAuditResult = aiVideoModerationUtil.auditVideos(videoUrls);
|
|
@@ -1172,8 +1180,366 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
queryWrapper.eq("id", id);
|
|
queryWrapper.eq("id", id);
|
|
|
queryWrapper.eq("delete_flag", 0);
|
|
queryWrapper.eq("delete_flag", 0);
|
|
|
return storeStaffConfigMapper.selectOne(queryWrapper);
|
|
return storeStaffConfigMapper.selectOne(queryWrapper);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 员工详情查询(包含演出列表)(用户端)
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 查询员工基本信息以及关联的演出安排列表
|
|
|
|
|
+ * 演出安排列表包含未来30天内的所有演出时间
|
|
|
|
|
+ * </p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id 员工主键ID,必须大于0
|
|
|
|
|
+ * @return 员工详情(包含演出列表),如果员工不存在则返回null
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public StoreStaffDetailWithPerformanceVo queryStaffDetailWithPerformance(Integer id) {
|
|
|
|
|
+ log.info("查询员工详情(包含演出列表),id={}", id);
|
|
|
|
|
+
|
|
|
|
|
+ // 参数校验
|
|
|
|
|
+ if (id == null || id <= 0) {
|
|
|
|
|
+ log.warn("查询员工详情失败,员工ID无效:{}", id);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 查询员工基本信息
|
|
|
|
|
+ StoreStaffConfig staffConfig = queryStaffDetail(id);
|
|
|
|
|
+ if (staffConfig == null) {
|
|
|
|
|
+ log.warn("查询员工详情失败,员工不存在:id={}", id);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询演出安排列表
|
|
|
|
|
+ List<PerformanceScheduleVo> performanceScheduleList =
|
|
|
|
|
+ queryPerformanceScheduleList(id);
|
|
|
|
|
+
|
|
|
|
|
+ // 构建返回对象
|
|
|
|
|
+ StoreStaffDetailWithPerformanceVo result =
|
|
|
|
|
+ new StoreStaffDetailWithPerformanceVo();
|
|
|
|
|
+ result.setStaffInfo(staffConfig);
|
|
|
|
|
+ result.setPerformanceScheduleList(performanceScheduleList);
|
|
|
|
|
+
|
|
|
|
|
+ log.info("查询员工详情(包含演出列表)成功,id={},演出安排数量:{}",
|
|
|
|
|
+ id, performanceScheduleList != null ? performanceScheduleList.size() : 0);
|
|
|
|
|
+ return result;
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("查询员工详情(包含演出列表)异常,id={},异常信息:{}", id, e.getMessage(), e);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询员工演出安排列表
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 查询该员工关联的所有演出,并根据演出类型生成未来30天内的演出安排列表
|
|
|
|
|
+ * </p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param staffId 员工ID
|
|
|
|
|
+ * @return 演出安排列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<PerformanceScheduleVo> queryPerformanceScheduleList(Integer staffId) {
|
|
|
|
|
+ List<PerformanceScheduleVo> scheduleList = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 查询包含该员工的所有演出
|
|
|
|
|
+ LambdaQueryWrapper<BarPerformance> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(BarPerformance::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE)
|
|
|
|
|
+ .eq(BarPerformance::getReviewStatus, CommonConstant.PERFORMANCE_REVIEW_STATUS_APPROVED)
|
|
|
|
|
+ .eq(BarPerformance::getOnlineStatus, CommonConstant.PERFORMANCE_ONLINE_STATUS_ONLINE)
|
|
|
|
|
+ .like(BarPerformance::getStaffConfigIds, staffId.toString())
|
|
|
|
|
+ .orderByAsc(BarPerformance::getCreatedTime);
|
|
|
|
|
+
|
|
|
|
|
+ List<BarPerformance> performances = barPerformanceMapper.selectList(queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ if (performances == null || performances.isEmpty()) {
|
|
|
|
|
+ return scheduleList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取未来30天的日期范围
|
|
|
|
|
+ Date now = new Date();
|
|
|
|
|
+ java.util.Calendar cal = java.util.Calendar.getInstance();
|
|
|
|
|
+ cal.setTime(now);
|
|
|
|
|
+ cal.set(java.util.Calendar.HOUR_OF_DAY, 0);
|
|
|
|
|
+ cal.set(java.util.Calendar.MINUTE, 0);
|
|
|
|
|
+ cal.set(java.util.Calendar.SECOND, 0);
|
|
|
|
|
+ cal.set(java.util.Calendar.MILLISECOND, 0);
|
|
|
|
|
+ Date todayStart = cal.getTime();
|
|
|
|
|
+
|
|
|
|
|
+ cal.add(java.util.Calendar.DAY_OF_MONTH, 30);
|
|
|
|
|
+ Date futureEnd = cal.getTime();
|
|
|
|
|
+
|
|
|
|
|
+ // 遍历演出,生成演出安排列表
|
|
|
|
|
+ for (BarPerformance performance : performances) {
|
|
|
|
|
+ String frequency = performance.getPerformanceFrequency();
|
|
|
|
|
+ if (StringUtils.isEmpty(frequency)) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ switch (frequency) {
|
|
|
|
|
+ case CommonConstant.PERFORMANCE_FREQUENCY_SINGLE:
|
|
|
|
|
+ // 单次演出
|
|
|
|
|
+ generateSinglePerformanceSchedule(performance, todayStart, futureEnd, scheduleList);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case CommonConstant.PERFORMANCE_FREQUENCY_DAILY:
|
|
|
|
|
+ // 每天定时
|
|
|
|
|
+ generateDailyPerformanceSchedule(performance, todayStart, futureEnd, scheduleList);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case CommonConstant.PERFORMANCE_FREQUENCY_WEEKLY:
|
|
|
|
|
+ // 每周定时
|
|
|
|
|
+ generateWeeklyPerformanceSchedule(performance, todayStart, futureEnd, scheduleList);
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 按日期和时间排序
|
|
|
|
|
+ scheduleList.sort((a, b) -> {
|
|
|
|
|
+ // 先按日期排序,再按时间排序
|
|
|
|
|
+ int dateCompare = a.getDateStr().compareTo(b.getDateStr());
|
|
|
|
|
+ if (dateCompare != 0) {
|
|
|
|
|
+ return dateCompare;
|
|
|
|
|
+ }
|
|
|
|
|
+ return a.getTimeRange().compareTo(b.getTimeRange());
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return scheduleList;
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("查询员工演出安排列表异常,staffId={},异常信息:{}", staffId, e.getMessage(), e);
|
|
|
|
|
+ return scheduleList;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成单次演出安排
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param performance 演出信息
|
|
|
|
|
+ * @param todayStart 今天开始时间
|
|
|
|
|
+ * @param futureEnd 未来结束时间
|
|
|
|
|
+ * @param scheduleList 演出安排列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private void generateSinglePerformanceSchedule(BarPerformance performance, Date todayStart, Date futureEnd,
|
|
|
|
|
+ List<PerformanceScheduleVo> scheduleList) {
|
|
|
|
|
+ Date singleStart = performance.getSingleStartDatetime();
|
|
|
|
|
+ Date singleEnd = performance.getSingleEndDatetime();
|
|
|
|
|
+ if (singleStart == null || singleEnd == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 只处理未来30天内的演出
|
|
|
|
|
+ if (singleStart.before(todayStart) || singleStart.after(futureEnd)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ PerformanceScheduleVo schedule = buildPerformanceScheduleVo(
|
|
|
|
|
+ performance, singleStart, singleEnd);
|
|
|
|
|
+ scheduleList.add(schedule);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成每天定时演出安排
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param performance 演出信息
|
|
|
|
|
+ * @param todayStart 今天开始时间
|
|
|
|
|
+ * @param futureEnd 未来结束时间
|
|
|
|
|
+ * @param scheduleList 演出安排列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private void generateDailyPerformanceSchedule(BarPerformance performance, Date todayStart, Date futureEnd,
|
|
|
|
|
+ List<PerformanceScheduleVo> scheduleList) {
|
|
|
|
|
+ Date dailyStart = performance.getDailyStartDate();
|
|
|
|
|
+ Date dailyEnd = performance.getDailyEndDate();
|
|
|
|
|
+ if (dailyStart == null || dailyEnd == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 确定查询的起始日期(取今天和演出开始日期的较大者)
|
|
|
|
|
+ Date queryStart = dailyStart.before(todayStart) ? todayStart : dailyStart;
|
|
|
|
|
+ // 确定查询的结束日期(取未来30天和演出结束日期的较小者)
|
|
|
|
|
+ Date queryEnd = dailyEnd.after(futureEnd) ? futureEnd : dailyEnd;
|
|
|
|
|
+
|
|
|
|
|
+ if (queryStart.after(queryEnd)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 从开始日期到结束日期,每天生成一条记录
|
|
|
|
|
+ java.util.Calendar cal = java.util.Calendar.getInstance();
|
|
|
|
|
+ cal.setTime(queryStart);
|
|
|
|
|
+ while (!cal.getTime().after(queryEnd)) {
|
|
|
|
|
+ Date currentDate = cal.getTime();
|
|
|
|
|
+ // 这里需要从演出信息中获取时间,但BarPerformance中没有存储具体时间
|
|
|
|
|
+ // 假设使用singleStartDatetime和singleEndDatetime的时间部分
|
|
|
|
|
+ Date scheduleStart = combineDateAndTime(currentDate, performance.getSingleStartDatetime());
|
|
|
|
|
+ Date scheduleEnd = combineDateAndTime(currentDate, performance.getSingleEndDatetime());
|
|
|
|
|
+
|
|
|
|
|
+ // 如果结束时间小于开始时间,说明跨天了
|
|
|
|
|
+ if (scheduleEnd.before(scheduleStart)) {
|
|
|
|
|
+ java.util.Calendar endCal = java.util.Calendar.getInstance();
|
|
|
|
|
+ endCal.setTime(scheduleEnd);
|
|
|
|
|
+ endCal.add(java.util.Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
+ scheduleEnd = endCal.getTime();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ PerformanceScheduleVo schedule = buildPerformanceScheduleVo(
|
|
|
|
|
+ performance, scheduleStart, scheduleEnd);
|
|
|
|
|
+ scheduleList.add(schedule);
|
|
|
|
|
+
|
|
|
|
|
+ cal.add(java.util.Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成每周定时演出安排
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param performance 演出信息
|
|
|
|
|
+ * @param todayStart 今天开始时间
|
|
|
|
|
+ * @param futureEnd 未来结束时间
|
|
|
|
|
+ * @param scheduleList 演出安排列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private void generateWeeklyPerformanceSchedule(BarPerformance performance, Date todayStart, Date futureEnd,
|
|
|
|
|
+ List<PerformanceScheduleVo> scheduleList) {
|
|
|
|
|
+ Date weeklyStart = performance.getDailyStartDate();
|
|
|
|
|
+ Date weeklyEnd = performance.getDailyEndDate();
|
|
|
|
|
+ String performanceWeek = performance.getPerformanceWeek();
|
|
|
|
|
+ if (weeklyStart == null || weeklyEnd == null || StringUtils.isEmpty(performanceWeek)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 确定查询的起始日期
|
|
|
|
|
+ Date queryStart = weeklyStart.before(todayStart) ? todayStart : weeklyStart;
|
|
|
|
|
+ // 确定查询的结束日期
|
|
|
|
|
+ Date queryEnd = weeklyEnd.after(futureEnd) ? futureEnd : weeklyEnd;
|
|
|
|
|
+
|
|
|
|
|
+ if (queryStart.after(queryEnd)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 解析星期几列表
|
|
|
|
|
+ java.util.Set<String> weekDaySet = new java.util.HashSet<>();
|
|
|
|
|
+ String[] weekDays = performanceWeek.split(",");
|
|
|
|
|
+ for (String weekDay : weekDays) {
|
|
|
|
|
+ if (StringUtils.isNotEmpty(weekDay.trim())) {
|
|
|
|
|
+ weekDaySet.add(weekDay.trim());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 从开始日期到结束日期,只生成符合星期几的日期
|
|
|
|
|
+ java.util.Calendar cal = java.util.Calendar.getInstance();
|
|
|
|
|
+ cal.setTime(queryStart);
|
|
|
|
|
+ while (!cal.getTime().after(queryEnd)) {
|
|
|
|
|
+ // 获取当前日期是星期几(0-周一,1-周二,...,6-周日)
|
|
|
|
|
+ int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
|
|
|
|
|
+ int todayWeekDay = (dayOfWeek == 1) ? 6 : (dayOfWeek - 2);
|
|
|
|
|
+ String todayWeekDayStr = String.valueOf(todayWeekDay);
|
|
|
|
|
+
|
|
|
|
|
+ if (weekDaySet.contains(todayWeekDayStr)) {
|
|
|
|
|
+ Date currentDate = cal.getTime();
|
|
|
|
|
+ Date scheduleStart = combineDateAndTime(currentDate, performance.getSingleStartDatetime());
|
|
|
|
|
+ Date scheduleEnd = combineDateAndTime(currentDate, performance.getSingleEndDatetime());
|
|
|
|
|
+
|
|
|
|
|
+ // 如果结束时间小于开始时间,说明跨天了
|
|
|
|
|
+ if (scheduleEnd.before(scheduleStart)) {
|
|
|
|
|
+ java.util.Calendar endCal = java.util.Calendar.getInstance();
|
|
|
|
|
+ endCal.setTime(scheduleEnd);
|
|
|
|
|
+ endCal.add(java.util.Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
+ scheduleEnd = endCal.getTime();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ shop.alien.entity.store.vo.PerformanceScheduleVo schedule = buildPerformanceScheduleVo(
|
|
|
|
|
+ performance, scheduleStart, scheduleEnd);
|
|
|
|
|
+ scheduleList.add(schedule);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ cal.add(java.util.Calendar.DAY_OF_MONTH, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 构建演出安排VO
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param performance 演出信息
|
|
|
|
|
+ * @param startTime 开始时间
|
|
|
|
|
+ * @param endTime 结束时间
|
|
|
|
|
+ * @return 演出安排VO
|
|
|
|
|
+ */
|
|
|
|
|
+ private PerformanceScheduleVo buildPerformanceScheduleVo(
|
|
|
|
|
+ BarPerformance performance, Date startTime, Date endTime) {
|
|
|
|
|
+ PerformanceScheduleVo schedule =
|
|
|
|
|
+ new PerformanceScheduleVo();
|
|
|
|
|
+
|
|
|
|
|
+ schedule.setPerformanceId(performance.getId());
|
|
|
|
|
+ schedule.setPerformanceName(performance.getPerformanceName());
|
|
|
|
|
+
|
|
|
|
|
+ // 格式化日期和时间
|
|
|
|
|
+ java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat("M月d日");
|
|
|
|
|
+ java.text.SimpleDateFormat timeFormat = new java.text.SimpleDateFormat("HH:mm");
|
|
|
|
|
+
|
|
|
|
|
+ String dateStr = dateFormat.format(startTime);
|
|
|
|
|
+ String weekDayStr = getWeekDayStr(startTime);
|
|
|
|
|
+ String startTimeStr = timeFormat.format(startTime);
|
|
|
|
|
+
|
|
|
|
|
+ // 判断是否跨天
|
|
|
|
|
+ String endTimeStr;
|
|
|
|
|
+ java.util.Calendar startCal = java.util.Calendar.getInstance();
|
|
|
|
|
+ startCal.setTime(startTime);
|
|
|
|
|
+ java.util.Calendar endCal = java.util.Calendar.getInstance();
|
|
|
|
|
+ endCal.setTime(endTime);
|
|
|
|
|
+
|
|
|
|
|
+ boolean isNextDay = endCal.get(java.util.Calendar.DAY_OF_YEAR) > startCal.get(java.util.Calendar.DAY_OF_YEAR) ||
|
|
|
|
|
+ endCal.get(java.util.Calendar.YEAR) > startCal.get(java.util.Calendar.YEAR);
|
|
|
|
|
+
|
|
|
|
|
+ if (isNextDay) {
|
|
|
|
|
+ endTimeStr = "次日" + timeFormat.format(endTime);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ endTimeStr = timeFormat.format(endTime);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ schedule.setDateStr(dateStr);
|
|
|
|
|
+ schedule.setWeekDayStr(weekDayStr);
|
|
|
|
|
+ schedule.setTimeRange(startTimeStr + "-" + endTimeStr);
|
|
|
|
|
+
|
|
|
|
|
+ return schedule;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取星期几的中文表示
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param date 日期
|
|
|
|
|
+ * @return 星期几的中文表示(周一、周二、...、周日)
|
|
|
|
|
+ */
|
|
|
|
|
+ private String getWeekDayStr(Date date) {
|
|
|
|
|
+ java.util.Calendar cal = java.util.Calendar.getInstance();
|
|
|
|
|
+ cal.setTime(date);
|
|
|
|
|
+ int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
|
|
|
|
|
+ // Calendar中:1=周日,2=周一,...,7=周六
|
|
|
|
|
+ String[] weekDays = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
|
|
|
|
|
+ return weekDays[dayOfWeek - 1];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 合并日期和时间
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param date 日期
|
|
|
|
|
+ * @param timeSource 时间源(从中提取时间部分)
|
|
|
|
|
+ * @return 合并后的日期时间
|
|
|
|
|
+ */
|
|
|
|
|
+ private Date combineDateAndTime(Date date, Date timeSource) {
|
|
|
|
|
+ if (timeSource == null) {
|
|
|
|
|
+ return date;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ java.util.Calendar dateCal = java.util.Calendar.getInstance();
|
|
|
|
|
+ dateCal.setTime(date);
|
|
|
|
|
+
|
|
|
|
|
+ java.util.Calendar timeCal = java.util.Calendar.getInstance();
|
|
|
|
|
+ timeCal.setTime(timeSource);
|
|
|
|
|
+
|
|
|
|
|
+ dateCal.set(java.util.Calendar.HOUR_OF_DAY, timeCal.get(java.util.Calendar.HOUR_OF_DAY));
|
|
|
|
|
+ dateCal.set(java.util.Calendar.MINUTE, timeCal.get(java.util.Calendar.MINUTE));
|
|
|
|
|
+ dateCal.set(java.util.Calendar.SECOND, timeCal.get(java.util.Calendar.SECOND));
|
|
|
|
|
+ dateCal.set(java.util.Calendar.MILLISECOND, timeCal.get(java.util.Calendar.MILLISECOND));
|
|
|
|
|
+
|
|
|
|
|
+ return dateCal.getTime();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1222,7 +1588,7 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查询关联的课程信息
|
|
// 查询关联的课程信息
|
|
|
- List<shop.alien.entity.store.StoreStaffFitnessCourse> courseList =
|
|
|
|
|
|
|
+ List<StoreStaffFitnessCourse> courseList =
|
|
|
storeStaffFitnessCourseService.getListByStaffId(id);
|
|
storeStaffFitnessCourseService.getListByStaffId(id);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1284,11 +1650,11 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查询员工基本信息(运动健身)
|
|
// 查询员工基本信息(运动健身)
|
|
|
- shop.alien.entity.store.StoreStaffFitnessBase baseInfo = null;
|
|
|
|
|
|
|
+ StoreStaffFitnessBase baseInfo = null;
|
|
|
try {
|
|
try {
|
|
|
- shop.alien.entity.result.R<shop.alien.entity.store.StoreStaffFitnessBase> baseResult =
|
|
|
|
|
|
|
+ R<StoreStaffFitnessBase> baseResult =
|
|
|
storeStaffFitnessBaseService.getByStaffId(id);
|
|
storeStaffFitnessBaseService.getByStaffId(id);
|
|
|
- if (baseResult != null && shop.alien.entity.result.R.isSuccess(baseResult) && baseResult.getData() != null) {
|
|
|
|
|
|
|
+ if (baseResult != null && R.isSuccess(baseResult) && baseResult.getData() != null) {
|
|
|
baseInfo = baseResult.getData();
|
|
baseInfo = baseResult.getData();
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1297,16 +1663,16 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查询认证列表(type=1)
|
|
// 查询认证列表(type=1)
|
|
|
- List<shop.alien.entity.store.StoreStaffFitnessCertification> certificationList =
|
|
|
|
|
|
|
+ List<StoreStaffFitnessCertification> certificationList =
|
|
|
storeStaffFitnessCertificationService.getListByStaffIdAndType(id, CERTIFICATION_TYPE);
|
|
storeStaffFitnessCertificationService.getListByStaffIdAndType(id, CERTIFICATION_TYPE);
|
|
|
|
|
|
|
|
// 查询荣誉列表(type=2)
|
|
// 查询荣誉列表(type=2)
|
|
|
- List<shop.alien.entity.store.StoreStaffFitnessCertification> honorList =
|
|
|
|
|
|
|
+ List<StoreStaffFitnessCertification> honorList =
|
|
|
storeStaffFitnessCertificationService.getListByStaffIdAndType(id, HONOR_TYPE);
|
|
storeStaffFitnessCertificationService.getListByStaffIdAndType(id, HONOR_TYPE);
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询从业经历列表
|
|
// 查询从业经历列表
|
|
|
- List<shop.alien.entity.store.StoreStaffFitnessExperience> experienceList = null;
|
|
|
|
|
|
|
+ List<StoreStaffFitnessExperience> experienceList = null;
|
|
|
try {
|
|
try {
|
|
|
experienceList = storeStaffFitnessExperienceService.getListByStaffId(id);
|
|
experienceList = storeStaffFitnessExperienceService.getListByStaffId(id);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|