Merge remote-tracking branch 'origin/dev/feat/partner1.1_20230727' into dev/feat/partner1.1_20230727
This commit is contained in:
@@ -5,10 +5,12 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.HyInterviewDAO;
|
||||
import com.cool.store.dao.HyPartnerBaseInfoDAO;
|
||||
import com.cool.store.dto.log.CreateQualifyVerifyDTO;
|
||||
import com.cool.store.dto.log.LogBasicDTO;
|
||||
import com.cool.store.dto.mdm.AccessTokenDTO;
|
||||
@@ -27,6 +29,7 @@ import com.cool.store.request.data.flow.SkrRelshipProve;
|
||||
import com.cool.store.service.FlowService;
|
||||
import com.cool.store.service.HyPartnerLineInfoService;
|
||||
import com.cool.store.service.LogService;
|
||||
import com.cool.store.service.SmsService;
|
||||
import com.cool.store.utils.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -91,6 +94,11 @@ public class FlowServiceImpl implements FlowService {
|
||||
|
||||
@Autowired
|
||||
private HyPartnerLineInfoService hyPartnerLineInfoService;
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerBaseInfoDAO hyPartnerBaseInfoDAO;
|
||||
|
||||
@Autowired
|
||||
private HyInspectionMapper inspectionMapper;
|
||||
@@ -266,6 +274,9 @@ public class FlowServiceImpl implements FlowService {
|
||||
hyInspectionDO.setInterviewPlanId(Long.parseLong(interviewPlanId));
|
||||
hyInspectionDO.setCreateTime(DateUtil.formatDateTime(passDate));
|
||||
inspectionMapper.insertSelective(hyInspectionDO);
|
||||
//发送加盟商资质审核通过短信
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(partnerLineId);
|
||||
smsService.sendSms(null, CommonConstants.SMS_TEMPLATE_CODE_VERIFY, hyPartnerBaseInfoDO.getMobile());
|
||||
//记录日志
|
||||
LogBasicDTO log = LogBasicDTO.builder().operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
|
||||
.build();
|
||||
|
||||
@@ -8,15 +8,11 @@ import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.log.AddTagsDTO;
|
||||
import com.cool.store.dto.log.LineLogInfo;
|
||||
import com.cool.store.dto.log.UserInfoUpdateDTO;
|
||||
import com.cool.store.dto.log.WantInfoUpdateDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.BaseUserInfoRequest;
|
||||
@@ -78,6 +74,9 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
|
||||
@Override
|
||||
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber) {
|
||||
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
|
||||
@@ -181,6 +180,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
|
||||
@Override
|
||||
public Integer submitPartnerIntentInfo(PartnerIntentInfoRequest request) {
|
||||
boolean isUpdateIntentInfo = true;
|
||||
log.info("HyPartnerClerkServiceImpl#submitPartnerIntentInfo request:{}", JSONObject.toJSONString(request));
|
||||
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
@@ -196,6 +196,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
OperateTypeEnum operateTypeEnum = OperateTypeEnum.INTENT_INFO_UPDATE;
|
||||
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||
if(intentInfoDO == null){
|
||||
isUpdateIntentInfo = false;
|
||||
intentInfoDO = new HyPartnerIntentInfoDO();
|
||||
fillIntentInfo(intentInfoDO, request);
|
||||
hyPartnerIntentInfoDAO.insertSelective(intentInfoDO);
|
||||
@@ -220,11 +221,19 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
if (LineStatusEnum.PUBLIC_SEAS.getCode().equals(hyPartnerLineInfoDO.getLineStatus())){
|
||||
Boolean flag = hyPartnerLineInfoService.assignFollowUser(request.getPartnerId(), request.getWantShopArea(), request.getAcceptAdjustType());
|
||||
hyPartnerLineInfoDO.setLineStatus(flag ? LineStatusEnum.PRIVATE_SEAS.getCode() : LineStatusEnum.PUBLIC_SEAS.getCode());
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
if (flag){
|
||||
String investmentManager = hyPartnerLineInfoService.getAssignFollowUser(request.getPartnerId(), "intent");
|
||||
hyPartnerLineInfoDO.setInvestmentManager(investmentManager);
|
||||
userIdList.add(investmentManager);
|
||||
}
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
if(!isUpdateIntentInfo){
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY,userIdList,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(),DateUtil.formatDateTime(new Date()));
|
||||
}
|
||||
if(flag){//分配招商经理成功才发送分配招商经理的飞书工作通知
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
}
|
||||
}
|
||||
}
|
||||
//记录日志
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
@@ -26,12 +27,11 @@ import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.sql.Array;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -78,6 +78,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
@Resource
|
||||
HyPhoneLocationService hyPhoneLocationService;
|
||||
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@Override
|
||||
public StageCountVO selectStagePendingCount(String userId) {
|
||||
@@ -161,6 +166,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
&& WorkflowStatusEnum.INTERVIEW_2.getCode().equals(hyPartnerLineInfoDO.getWorkflowStatus())){
|
||||
workFlowService.transferInvestmentManager(WorkflowStageEnum.getWorkflowStageByCode(hyPartnerLineInfoDO.getWorkflowStage()),request);
|
||||
}
|
||||
//发送飞书工作通知
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(request.getLineId());
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerBaseInfoDO.getUsername(),hyPartnerBaseInfoDO.getMobile());
|
||||
|
||||
//添加日志
|
||||
LineLogInfo lineLogInfo = new LineLogInfo(hyPartnerLineInfoDO.getPartnerId(), hyPartnerLineInfoDO.getId(), user.getUserId(),
|
||||
@@ -215,9 +223,15 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
List<HyPartnerLineInfoDO> otherLineList = partnerLineInfoList.stream().filter(x -> x.getCloseTime() == null).collect(Collectors.toList());
|
||||
List<Long> otherLineIdList = otherLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
|
||||
hyPartnerLineInfoDAO.updateInvestmentManager(user.getUserId(), otherLineIdList);
|
||||
|
||||
//添加日志
|
||||
partnerLineInfoList.forEach(x->{
|
||||
//给招商经理发送飞书工作通知
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
userIdList.add(user.getUserId());
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(x.getId());
|
||||
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerBaseInfoDO.getUsername(),hyPartnerBaseInfoDO.getMobile());
|
||||
|
||||
LineLogInfo lineLogInfo = new LineLogInfo(x.getPartnerId(), x.getId(), user.getUserId(),
|
||||
user.getName(), OperateTypeEnum.ALLOCATION_INVESTMENT_MANAGER,
|
||||
WorkflowStageEnum.getWorkflowStageByCode(x.getWorkflowStage()),
|
||||
@@ -362,6 +376,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
hy.setCertifyFile(JSONObject.toJSONString(closeFollowRequest.getCertifyFile()));
|
||||
}
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(hy);
|
||||
IntentSmsReq intentSmsReq = new IntentSmsReq();
|
||||
intentSmsReq.setDeadLine(DateUtil.formatDateTime(hyPartnerLineInfoDO.getDeadline()));
|
||||
smsService.sendSms(JSON.toJSONString(intentSmsReq),CommonConstants.SMS_TEMPLATE_CODE_INTENT, hy.getMobile());
|
||||
}
|
||||
|
||||
//拒绝
|
||||
@@ -710,6 +727,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
}
|
||||
//发送飞书工作通知
|
||||
if(flag){
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
userIdList.add(investmentManager);
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
}
|
||||
return hyPartnerLineInfoDO;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dto.message.SendCardMessageDTO;
|
||||
import com.cool.store.enums.FeiShuNoticeMsgEnum;
|
||||
import com.cool.store.enums.MessageTypeEnum;
|
||||
import com.cool.store.http.ISVHttpRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-07-19 17:06
|
||||
* @Description:
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class NoticeService {
|
||||
@Value("${feishu.notice.link.url:null}")
|
||||
private String linkUrl;
|
||||
@Autowired
|
||||
private ISVHttpRequest isvHttpRequest;
|
||||
public void sendFeiShuNotice(FeiShuNoticeMsgEnum feiShuNoticeMsgEnum, List<String> userIds,Object... objects) {
|
||||
try{
|
||||
SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
|
||||
sendCardMessageDTO.setUserIds(userIds);
|
||||
sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
|
||||
sendCardMessageDTO.setMessageUrl(linkUrl);
|
||||
sendCardMessageDTO.setTitle(feiShuNoticeMsgEnum.getTitle());
|
||||
sendCardMessageDTO.setContent(MessageFormat.format(feiShuNoticeMsgEnum.getContent(),objects));
|
||||
isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO);
|
||||
}catch (Exception e){
|
||||
log.info("发送飞书通知失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,8 @@ public class ZoneServiceImpl implements ZoneService {
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
RegionDAO regionDAO;
|
||||
@Resource
|
||||
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
|
||||
|
||||
|
||||
@@ -67,8 +69,9 @@ public class ZoneServiceImpl implements ZoneService {
|
||||
//添加战区映射的意向区域
|
||||
hyIntendDevMappingDAO.deleteByOpenAreaIds(intentAreaSettingRequest.getOpenAreaIdList(),hyIntendDevZoneInfoDO.getType());
|
||||
List<Long> openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList();
|
||||
List<Long> openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList);
|
||||
List<HyIntendDevelopementMappingDO> list = new ArrayList<>();
|
||||
openAreaIdList.stream().forEach(x->{
|
||||
openAreaIdFilterList.stream().forEach(x->{
|
||||
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO();
|
||||
hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType());
|
||||
hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x));
|
||||
@@ -95,8 +98,9 @@ public class ZoneServiceImpl implements ZoneService {
|
||||
hyIntendDevMappingDAO.deleteByMappingIds(Arrays.asList(intentAreaSettingRequest.getId())
|
||||
,intentAreaSettingRequest.getType());
|
||||
List<Long> openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList();
|
||||
List<Long> openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList);
|
||||
List<HyIntendDevelopementMappingDO> list = new ArrayList<>();
|
||||
openAreaIdList.stream().forEach(x->{
|
||||
openAreaIdFilterList.stream().forEach(x->{
|
||||
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO();
|
||||
hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType());
|
||||
hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x));
|
||||
@@ -206,7 +210,8 @@ public class ZoneServiceImpl implements ZoneService {
|
||||
//查询已经绑定战区的 意向区域
|
||||
List<ZoneCheckDTO> list = hyIntendDevMappingDAO.selectByOpenAreaMappingIdList(intentAreaSettingRequest.getOpenAreaIdList(),intentAreaSettingRequest.getType(),intentAreaSettingRequest.getId());
|
||||
List<Long> openAreaIdList = list.stream().map(ZoneCheckDTO::getOpenAreaMappingId).collect(Collectors.toList());
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdList);
|
||||
List<Long> openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList);
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdFilterList);
|
||||
Map<Long, String> areaNameMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName));
|
||||
List<ZoneCheckVO> result = new ArrayList<>();
|
||||
list.forEach(x->{
|
||||
|
||||
Reference in New Issue
Block a user