Merge remote-tracking branch 'hsayi/dev/feat/partner1.3_20230828' into dev/feat/partner1.3_20230828

This commit is contained in:
苏竹红
2023-08-17 16:40:02 +08:00
10 changed files with 47 additions and 20 deletions

View File

@@ -105,6 +105,8 @@ public class CommonConstants {
public static final int HUNDRED = 100;
public static final int FIVE_HUNDRED = 100;
public static final int ONE_THOUSAND = 1000;
public static final int FIFTY_FIVE = 55;
public static final int SIXTY_FIVE = 65;
public static final String ONE_STR = "1";

View File

@@ -12,6 +12,6 @@ public class MessageConstants {
public static final String FOLLOW_TASK_MESSAGE_CONTENT = "您有一个线索跟进任务将于{0}截止 ,线索信息{1}手机号{2},请及时跟进";
public static final String FOLLOW_TASK_MESSAGE_CONTENT_1 = "您有{0}个线索跟进任务将于今日截止,及{1}个跟进任务已逾期,请及时跟进";
public static final String FOLLOW_TASK_MESSAGE_CONTENT_2 = "您有{0}个跟进任务已逾期,请及时跟进";
public static final String FOLLOW_TASK_MESSAGE_CONTENT_3 = "您有{1}个线索跟进任务将于今日截止,请及时跟进";
public static final String FOLLOW_TASK_MESSAGE_CONTENT_3 = "您有{0}个线索跟进任务将于今日截止,请及时跟进";
}

View File

@@ -1,5 +1,7 @@
package com.cool.store.enums;
import com.alibaba.fastjson.JSONObject;
/**
* @author zhangchenbiao
* @FileName: MessageTypeEnum
@@ -8,7 +10,8 @@ package com.cool.store.enums;
*/
public enum MessageTypeEnum {
SCHEDULE_REMINDER("schedule_reminder", "日历提醒事件", "img_v2_0709ece3-77a8-49a4-820f-f245b2a4fdag")
SCHEDULE_REMINDER("schedule_reminder", "日历提醒事件", "img_v2_0709ece3-77a8-49a4-820f-f245b2a4fdag"),
FOLLOW_TASK("follow_task", "跟进任务提醒", "img_v2_0709ece3-77a8-49a4-820f-f245b2a4fdag")
@@ -46,4 +49,13 @@ public enum MessageTypeEnum {
}
return null;
}
public JSONObject getMessageTypeObject() {
JSONObject object = new JSONObject();
object.put("code", this.code);
object.put("name", this.name);
object.put("imageMediaId", this.imageMediaId);
return object;
}
}

View File

@@ -178,7 +178,7 @@
<select id="getUserTaskNum" resultType="com.cool.store.dto.follow.FollowTaskNumDTO">
select
follow_user_id,
sum(if(task_status=2 or (task_status in ('0') and now() >= deadline, 1,0))) as overdueNum,
sum(if(task_status=2 or (task_status in ('0') and now() >= deadline), 1,0)) as overdueNum,
sum(if(task_status=0, 1, 0)) as todoNum
from
hy_follow_task
@@ -193,11 +193,11 @@
from
hy_follow_task
where
deleted = '0' and task_status in ('0') and deadline >= #{startTime} and #{endTime} >= deadline
deleted = '0' and task_status in ('0') and deadline > #{startTime} and #{endTime} > deadline
</select>
<update id="updateUndoTaskStatusToOverdue">
<![CDATA[ update hy_follow_task set task_status = '2' where task_status = '0' and deadline < now() ]]]>
<![CDATA[ update hy_follow_task set task_status = '2' where task_status = '0' and deadline < now() ]]>
</update>
<select id="getFollowTaskList" resultMap="BaseResultMap">

View File

@@ -10,14 +10,11 @@ import com.cool.store.dto.enterprise.SysDepartmentDTO;
import com.cool.store.dto.login.UserIdInfoDTO;
import com.cool.store.dto.message.SendCardMessageDTO;
import com.cool.store.dto.response.ResultDTO;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.MessageTypeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.EnterpriseUserRequest;
import com.cool.store.utils.RestTemplateUtil;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -27,7 +24,6 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@@ -361,7 +357,10 @@ public class ISVHttpRequest {
String url = isvDomain + "/sendFeiShuCardMessage";
ResultDTO responseEntity = null;
try {
responseEntity = httpRestTemplateService.postForObject(url, param, ResultDTO.class);
MessageTypeEnum messageType = param.getMessageType();
JSONObject request = JSONObject.parseObject(JSONObject.toJSONString(param));
request.put("messageType", messageType.getMessageTypeObject());
responseEntity = httpRestTemplateService.postForObject(url, request, ResultDTO.class);
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
} catch (Exception e) {
log.info("调用isv出错{}", e);

View File

@@ -1,11 +1,14 @@
package com.cool.store.job;
import com.cool.store.constants.CommonConstants;
import com.cool.store.service.EnterpriseSyncService;
import com.cool.store.service.FollowTaskService;
import com.cool.store.service.HyPartnerInterviewPlanService;
import com.cool.store.utils.UUIDUtils;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -83,6 +86,7 @@ public class JobHandler {
@XxlJob("followTaskAnHourAgoRemind")
public void followTaskAnHourAgoRemind(){
try {
MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get8UUID());
log.info("跟进任务前一小时提醒开始");
followTaskService.followTaskAnHourAgoRemind();
log.info("跟进任务前一小时提醒结束");
@@ -93,11 +97,12 @@ public class JobHandler {
}
}
@XxlJob("followTaskRemind")
public void followTaskRemind(){
@XxlJob("followTaskDailyRemind")
public void followTaskDailyRemind(){
try {
MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get8UUID());
log.info("跟进任务提醒开始");
followTaskService.followTaskRemind();
followTaskService.followTaskDailyRemind();
log.info("跟进任务提醒结束");
XxlJobHelper.handleSuccess();
}catch (Exception e){

View File

@@ -87,5 +87,5 @@ public interface FollowTaskService {
* 跟进任务每日10点提醒
* @return
*/
void followTaskRemind();
void followTaskDailyRemind();
}

View File

@@ -189,8 +189,8 @@ public class FollowTaskServiceImpl implements FollowTaskService {
//获取一个小时后的任务
Boolean hasNext = true;
int pageNum = CommonConstants.ONE, pageSize = CommonConstants.HUNDRED;
String startTime = DateUtil.format(DateUtils.addMinutes(new Date(), -CommonConstants.FIVE), CoolDateUtils.DATE_FORMAT_SEC);
String endTime = DateUtil.format(DateUtils.addMinutes(new Date(), CommonConstants.FIVE), CoolDateUtils.DATE_FORMAT_SEC);
String startTime = DateUtil.format(DateUtils.addMinutes(new Date(), CommonConstants.FIFTY_FIVE), CoolDateUtils.DATE_FORMAT_SEC);
String endTime = DateUtil.format(DateUtils.addMinutes(new Date(), CommonConstants.SIXTY_FIVE), CoolDateUtils.DATE_FORMAT_SEC);
while (hasNext){
Page<HyFollowTaskDO> undoTaskList = hyFollowTaskDAO.getUndoTaskPage(startTime, endTime, pageNum, pageSize);
if(CollectionUtils.isEmpty(undoTaskList)){
@@ -233,7 +233,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
}
@Override
public void followTaskRemind() {
public void followTaskDailyRemind() {
//获取已逾期的 以及截止时间为当天的任务 的招商经理
Boolean hasNext = true;
int pageNum = CommonConstants.ONE, pageSize = CommonConstants.HUNDRED;

View File

@@ -52,8 +52,9 @@ public class TokenValidateFilter implements Filter {
"/partner/pc/flow/qualificationReview/callback",
"/**/ecSync/ecToApplet/**",
"/partner/pc/websocket/**",
"/partner/pc/call/**");
"/partner/pc/call/**",
//TODO 暂时放开前端 OSS 配置获取接口给安卓端调试
"/partner/pc/oss/**");
/**
* @param uri

View File

@@ -60,6 +60,8 @@ public class TestController {
private HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
@Resource
private OpenAreaService openAreaService;
@Resource
private FollowTaskService followTaskService;
@PostMapping("/post")
public ResponseResult<Boolean> get(@RequestBody List<TestRequest> testRequestList){
@@ -266,4 +268,10 @@ public class TestController {
}
return null;
}
@GetMapping("/followTaskDailyRemind")
public ResponseResult followTaskDailyRemind() {
followTaskService.followTaskDailyRemind();
return ResponseResult.success();
}
}