日程排序

This commit is contained in:
苏竹红
2023-07-03 14:41:44 +08:00
parent 3b5f73fb25
commit f1ef28b733
7 changed files with 35 additions and 10 deletions

View File

@@ -262,12 +262,7 @@
<if test="currentDate!=null and currentDate!=''">
and deadline = #{currentDate}
</if>
and
(
(workflow_stage = 1 and workflow_status = 0) or
(workflow_stage = 2 and workflow_status = 0) or
(workflow_stage = 3 and workflow_status = 4)
)
and (workflow_stage = 2 and workflow_status = 0)
</where>
</select>

View File

@@ -10,7 +10,7 @@ import lombok.Data;
* @date 2023-06-13 11:18
*/
@Data
public class UserCalendarsEventDTO {
public class UserCalendarsEventDTO implements Comparable<UserCalendarsEventDTO>{
@ApiModelProperty("日历id")
private String calendarId;
@@ -34,4 +34,9 @@ public class UserCalendarsEventDTO {
this.startTime = startTime;
this.endTime = endTime;
}
@Override
public int compareTo(UserCalendarsEventDTO other) {
return this.startTime.compareTo(other.getStartTime());
}
}

View File

@@ -19,6 +19,8 @@ public class InviteCodeDetailVO {
private String partnerPhone;
@ApiModelProperty("邀请码")
private String inviteCode;
@ApiModelProperty("门店编码")
private String storeCode;
@ApiModelProperty("门店名称")
private String storeName;

View File

@@ -1,10 +1,13 @@
package com.cool.store.service;
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
import com.cool.store.exception.ApiException;
import com.cool.store.vo.InterviewPlanVO;
import com.cool.store.vo.InterviewScheduleInfoVO;
import com.cool.store.vo.StageCountVO;
import java.util.Date;
import java.util.List;
/**
* @Author suzhuhong
@@ -38,6 +41,15 @@ public interface DeskService {
*/
StageCountVO getStageCountByType(String userId,String type);
/**
* String userId, long startTime, long endTime
* @param userId
* @param startTime
* @param endTime
* @return
*/
List<UserCalendarsEventDTO> getUserCalendarsEvents(String userId, long startTime, long endTime) throws ApiException;

View File

@@ -5,9 +5,12 @@ import cn.hutool.core.date.DateUtil;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.HyPartnerInterviewPlanDAO;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.service.DeskService;
import com.cool.store.service.HyPartnerInterviewPlanService;
import com.cool.store.service.HyPartnerLineInfoService;
@@ -21,6 +24,7 @@ import org.apache.http.client.utils.DateUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -40,6 +44,8 @@ public class DeskServiceImpl implements DeskService {
HyPartnerInterviewPlanService hyPartnerInterviewPlanService;
@Resource
HyPartnerLineInfoService hyPartnerLineInfoService;
@Resource
private ISVHttpRequest isvHttpRequest;
@Override
public InterviewPlanVO getInterviewPlan(String userId) {
@@ -91,5 +97,11 @@ public class DeskServiceImpl implements DeskService {
return null;
}
@Override
public List<UserCalendarsEventDTO> getUserCalendarsEvents(String userId, long startTime, long endTime) throws ApiException {
List<UserCalendarsEventDTO> userCalendarsEvents = isvHttpRequest.getUserCalendarsEvents(userId, startTime, endTime);
Collections.sort(userCalendarsEvents);
return userCalendarsEvents;
}
}

View File

@@ -88,6 +88,7 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
InviteCodeDetailVO inviteCodeDetailVO = new InviteCodeDetailVO();
inviteCodeDetailVO.setInviteCode(hyPartnerUserInfoDO.getInviteCode());
inviteCodeDetailVO.setStoreName(hyPartnerUserInfoDO.getRecommendPartnerName());
inviteCodeDetailVO.setStoreCode(hyPartnerUserInfoDO.getShopCode());
inviteCodeDetailVO.setPartnerPhone(hyPartnerUserInfoDO.getRecommendPartnerMobile());
inviteCodeDetailVO.setPartnerName(hyPartnerUserInfoDO.getShopName());
return inviteCodeDetailVO;

View File

@@ -43,8 +43,6 @@ public class DeskController {
@Resource
HyPartnerBaseInfoService hyPartnerBaseInfoService;
@Resource
private ISVHttpRequest isvHttpRequest;
@Resource
EnterpriseUserService enterpriseUserService;
@Resource
PartnerUserInfoService partnerUserInfoService;
@@ -78,7 +76,7 @@ public class DeskController {
public ResponseResult<List<UserCalendarsEventDTO>> getUserCalendarsEvents(@RequestParam(value = "startTime") Long startTime,
@RequestParam(value = "endTime") Long endTime) throws ApiException {
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(isvHttpRequest.getUserCalendarsEvents(userId,startTime,endTime));
return ResponseResult.success(deskService.getUserCalendarsEvents(userId,startTime,endTime));
}