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

This commit is contained in:
feng.li
2023-08-23 13:35:48 +08:00
11 changed files with 81 additions and 38 deletions

View File

@@ -10,10 +10,10 @@ import com.alibaba.fastjson.JSONObject;
public enum FeiShuNoticeMsgEnum {
common_notice("工作台通知", "{0}", "img_v2_45d7a901-1eab-498b-a760-b38d287f0c1g"),
ALLOCATION_INVESTMENT_MANAGER("分配招商经理", "有新的线索 于 {0} 分配给您,线索信息{1}手机号{2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
TRANS_INVESTMENT_MANAGER("转让招商经理", "有新的线索 于 {0} 转让给您,线索信息{1}手机号{2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
BATCH_TRANS_INVESTMENT_MANAGER("收到新线索", "有{0}条新线索 于 {1} 转让给您,请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
INTENTION_APPLY("加盟意向申请", "您有一个【加盟意向申请】待审核,申请人{0}手机号{1}于 {2} 提交加盟意向申请,请及时处理", "img_v2_69eb6e5f-bf12-4a02-a47f-b17ce24fcfeg"),
ALLOCATION_INVESTMENT_MANAGER("分配招商经理", "有新的线索于 {0} 分配给您,线索信息 {1} 手机号 {2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
TRANS_INVESTMENT_MANAGER("转让招商经理", "有新的线索于 {0} 转让给您,线索信息 {1} 手机号 {2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
BATCH_TRANS_INVESTMENT_MANAGER("收到新线索", "有{0}条新线索于 {1} 转让给您,请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
INTENTION_APPLY("加盟意向申请", "您有一个【加盟意向申请】待审核,申请人 {0} 手机号 {1} 于 {2} 提交加盟意向申请,请及时处理", "img_v2_69eb6e5f-bf12-4a02-a47f-b17ce24fcfeg"),
FOLLOW_TASK("线索跟进任务", "{0}", "img_v2_1960b7ef-8c4e-4c3d-8b67-3d918a85578g"),
INTERVIEW_APPOINTMENT("面试预约申请", "{0}","img_v2_107bb06b-2a7a-43e1-a6ae-e5d2f2dae17g"),
;

View File

@@ -178,11 +178,12 @@ public class HyFollowTaskDAO {
* @param followUserIds
* @return
*/
public List<FollowTaskNumDTO> getUserTaskNum(List<String> followUserIds){
if(CollectionUtils.isEmpty(followUserIds)){
public List<FollowTaskNumDTO> getUserTaskNum(List<String> followUserIds, Date date){
if(CollectionUtils.isEmpty(followUserIds) || Objects.isNull(date)){
return Lists.newArrayList();
}
return hyFollowTaskMapper.getUserTaskNum(followUserIds);
String endTime = DateUtil.format(date, CoolDateUtils.DATE_FORMAT_DAY) + CommonConstants.DAY_END_TIME_SUFFIX;
return hyFollowTaskMapper.getUserTaskNum(followUserIds, endTime);
}
/**

View File

@@ -78,7 +78,7 @@ public interface HyFollowTaskMapper {
* @param followUserIds
* @return
*/
List<FollowTaskNumDTO> getUserTaskNum(@Param("followUserIds") List<String> followUserIds);
List<FollowTaskNumDTO> getUserTaskNum(@Param("followUserIds") List<String> followUserIds, @Param("endTime")String endTime);
/**
* 获取待完成任务

View File

@@ -143,20 +143,33 @@
<select id="getTaskPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
a.id,
a.partner_line_id,
a.follow_user_id,
a.task_title,
a.communication_type,
a.deadline,
a.communication_content,
a.task_status,
a.finish_time,
a.deleted,
a.create_time,
a.update_time
from
hy_follow_task
hy_follow_task a
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0'
where
deleted = '0' and follow_user_id = #{followUserId}
a.deleted = '0' and a.follow_user_id = #{followUserId}
<if test="taskStatus != null">
and task_status = #{taskStatus}
and a.task_status = #{taskStatus}
</if>
<if test="deadlineStartTime != null">
and deadline >= #{deadlineStartTime}
and a.deadline >= #{deadlineStartTime}
</if>
<if test="deadlineEndTime != null">
<![CDATA[ and deadline <= #{deadlineEndTime}]]>
<![CDATA[ and a.deadline <= #{deadlineEndTime}]]>
</if>
order by a.deadline desc
</select>
<select id="getFollowTask" resultMap="BaseResultMap">
@@ -178,32 +191,46 @@
<select id="getRemindFollowUserIds" resultType="string">
select
follow_user_id
a.follow_user_id
from
hy_follow_task
hy_follow_task a
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0'
where
deleted = '0' and (task_status in ('2') or (task_status in ('0') and deadline >= #{startTime} and #{endTime} >= deadline))
a.deleted = '0' and (a.task_status in ('2') or (a.task_status in ('0') and a.deadline >= #{startTime} and #{endTime} >= a.deadline))
</select>
<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=0, 1, 0)) as todoNum
a.follow_user_id,
sum(if(a.task_status=2 or (a.task_status in ('0') and now() >= a.deadline), 1,0)) as overdueNum,
sum(if(a.task_status=0 and #{endTime} > a.deadline, 1, 0)) as todoNum
from
hy_follow_task
hy_follow_task a
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0'
where
follow_user_id in <foreach collection="followUserIds" item="followUserId" separator="," open="(" close=")">#{followUserId}</foreach>
group by follow_user_id
a.follow_user_id in <foreach collection="followUserIds" item="followUserId" separator="," open="(" close=")">#{followUserId}</foreach>
group by a.follow_user_id
</select>
<select id="getUndoTaskPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
a.id,
a.partner_line_id,
a.follow_user_id,
a.task_title,
a.communication_type,
a.deadline,
a.communication_content,
a.task_status,
a.finish_time,
a.deleted,
a.create_time,
a.update_time
from
hy_follow_task
hy_follow_task a
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0'
where
deleted = '0' and task_status in ('0') and deadline > #{startTime} and #{endTime} > deadline
a.deleted = '0' and a.task_status in ('0') and a.deadline > #{startTime} and #{endTime} > a.deadline
</select>
<update id="updateUndoTaskStatusToOverdue">

View File

@@ -114,7 +114,9 @@ public class PartnerIntentApplyInfoVO {
String trimmedPart = part.trim();
if (!trimmedPart.isEmpty()) {
try {
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
if (userPortraitMap.get(Long.valueOf(part)) != null){
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
}
} catch (NumberFormatException e) {
log.info("Invalid format: {}" , trimmedPart);
}

View File

@@ -145,7 +145,9 @@ public class PrivateSeaLineListVo {
String trimmedPart = part.trim();
if (!trimmedPart.isEmpty()) {
try {
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
if (userPortraitMap.get(Long.valueOf(part)) != null){
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
}
} catch (NumberFormatException e) {
log.info("Invalid format: {}" , trimmedPart);
}

View File

@@ -227,8 +227,9 @@ public class FollowTaskServiceImpl implements FollowTaskService {
//获取已逾期的 以及截止时间为当天的任务 的招商经理
Boolean hasNext = true;
int pageNum = CommonConstants.ONE, pageSize = CommonConstants.HUNDRED;
Date today = new Date();
while (hasNext){
Page<String> remindFollowUserIds = hyFollowTaskDAO.getRemindFollowUserIds(new Date(), pageNum, pageSize);
Page<String> remindFollowUserIds = hyFollowTaskDAO.getRemindFollowUserIds(today, pageNum, pageSize);
if(CollectionUtils.isEmpty(remindFollowUserIds)){
break;
}
@@ -236,7 +237,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
hasNext = false;
}
pageNum++;
List<FollowTaskNumDTO> followTaskList = hyFollowTaskDAO.getUserTaskNum(remindFollowUserIds);
List<FollowTaskNumDTO> followTaskList = hyFollowTaskDAO.getUserTaskNum(remindFollowUserIds, today);
for (FollowTaskNumDTO followTask : followTaskList) {
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(followTask.getFollowUserId()), FollowTaskNumDTO.getMessageContent(followTask));
}
@@ -265,12 +266,12 @@ public class FollowTaskServiceImpl implements FollowTaskService {
if(Objects.isNull(partnerInfo)){
return;
}
String lockKey = MessageFormat.format(CommonConstants.FOLLOW_TASK_NOTICE_KEY, task.getFollowUserId(), task.getId());
/*String lockKey = MessageFormat.format(CommonConstants.FOLLOW_TASK_NOTICE_KEY, task.getFollowUserId(), task.getId());
boolean result = redisUtilPool.setNxExpire(lockKey, DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC), CommonConstants.FOLLOW_TASK_NOTICE_LOCK_TIMES);
if(!result){
//一小时内发送过不再发送通知
return;
}
}*/
String dateline = DateUtil.format(task.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_7);
String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile());
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(task.getFollowUserId()), content);

View File

@@ -222,6 +222,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
if (CollectionUtils.isEmpty(request.getLineIds())||StringUtils.isEmpty(request.getUserId())){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
int num = request.getLineIds().size();
List<HyPartnerLineInfoDO> hyPartnerLineInfoList = hyPartnerLineInfoDAO.getHyPartnerLineInfoList(request.getLineIds(), request.getUserId());
//如果选中的线索中有线索招商经理已经是被装让的招商经理,则不允许批量操作
if (CollectionUtils.isNotEmpty(hyPartnerLineInfoList)){
@@ -232,13 +233,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
transferInvestmentManagerRequest.setUserId(request.getUserId());
transferInvestmentManagerRequest.setLineId(lineId);
try {
this.transferInvestmentManager(user,transferInvestmentManagerRequest,Boolean.FALSE);
this.transferInvestmentManager(user,transferInvestmentManagerRequest,num<=1?true:false);
} catch (ApiException e) {
log.info("transferInvestmentManager_success Transfer_interview_management_failed,lineId:{}",lineId);
}
}
if (request.getLineIds().size()!=0){
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),request.getLineIds().size(),DateUtil.format(new Date(),CoolDateUtils.DATE_FORMAT_SEC_7));
if (num>1){
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),num,DateUtil.format(new Date(),CoolDateUtils.DATE_FORMAT_SEC_7));
}
return Boolean.TRUE;
}
@@ -722,12 +723,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
}
//省内调剂 有重点或者开放的 分配
if (AcceptAdjustTypeEnum.PROVINCIAL_ADJUSTMENT.getCode().equals(acceptAdjustType)){
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList= new ArrayList<>();
if(hyOpenAreaInfoDO != null){
String areaPath = hyOpenAreaInfoDO.getAreaPath();
String province = areaPath.substring(0, areaPath.indexOf("/", areaPath.indexOf("/") + 1));
hyOpenAreaInfoDOList = hyOpenAreaInfoDAO.queryByKeyword(province, true, null, true);
//过滤一级目录
hyOpenAreaInfoDOList = hyOpenAreaInfoDOList.stream().filter(x->x.getParentId()!=null).collect(Collectors.toList());
}
if (hyOpenAreaInfoDOList.size()>CommonConstants.ZERO){
return Boolean.TRUE;

View File

@@ -146,7 +146,9 @@ public class LabelServiceImpl implements LabelService {
String trimmedPart = part.trim();
if (!trimmedPart.isEmpty()) {
try {
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
if (userPortraitMap.get(Long.valueOf(part)) != null){
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
}
} catch (NumberFormatException e) {
log.info("Invalid format: {}" , trimmedPart);
}

View File

@@ -233,7 +233,7 @@ public class LineHighSeasServiceImpl implements LineHighSeasService {
addLineRequest.setWantShopArea(hyPartnerLineDO.getWantShopArea().toString());
add(addLineRequest);
}
return new ResponseResult(200, "共上传" + lineDOList.size() + "条线索", new ErrorExcelResponse(lineDOList.size(), styleCells.size(), fileStr));
return new ResponseResult(ResponseCodeEnum.SUCCESS.getCode(), "共上传" + lineDOList.size() + "条线索", new ErrorExcelResponse(lineDOList.size(), styleCells.size(), fileStr));
}
/**

View File

@@ -274,4 +274,10 @@ public class TestController {
followTaskService.followTaskDailyRemind();
return ResponseResult.success();
}
@GetMapping("/followTaskAnHourAgoRemind")
public ResponseResult followTaskAnHourAgoRemind() {
followTaskService.followTaskAnHourAgoRemind();
return ResponseResult.success();
}
}