分配招商经理优化分配人

This commit is contained in:
苏竹红
2023-09-04 15:13:31 +08:00
parent ad770fd27b
commit 9fee83af41
4 changed files with 15 additions and 10 deletions

View File

@@ -67,6 +67,7 @@ public enum ErrorCodeEnum {
DATELINE_BEFORE_NOW(500012, "截止时间不能早于当前时间!", null),
NO_BATCH_TRANSFER_REQUIRED(500014, "已选线索包含此招商经理现有私海线索,无需转让,请检查后重试!", null),
PARTNER_MOBILE_EXIST(500010, "手机号码已存在,请核实!", null),
INVESTMENT_MANAGER_NOT_EXIST(500015, "当前招商经理不存在", null),
INTERVIEW_ENTER_FAIL(1021101, "进入面试间失败", null),
DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在,无法发起资质审核!", null),

View File

@@ -65,7 +65,7 @@ public interface HyPartnerLineInfoService {
* @param lineIdList
* @return
*/
Boolean allocationInvestmentManager(LoginUserInfo user, List<Long> lineIdList);
Boolean allocationInvestmentManager(LoginUserInfo user, String userId,List<Long> lineIdList);
/**

View File

@@ -272,10 +272,14 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
}
@Override
public Boolean allocationInvestmentManager(LoginUserInfo user, List<Long> lineIdList) {
if (user==null|| CollectionUtils.isEmpty(lineIdList)){
public Boolean allocationInvestmentManager(LoginUserInfo operateUser,String userId, List<Long> lineIdList) {
if (StringUtils.isEmpty(userId)|| CollectionUtils.isEmpty(lineIdList)){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
EnterpriseUserDO user = enterpriseUserDAO.getUserInfoById(userId);
if (user==null){
throw new ServiceException(ErrorCodeEnum.INVESTMENT_MANAGER_NOT_EXIST);
}
//加盟上线索集合
List<HyPartnerLineInfoDO> partnerLineInfoList= hyPartnerLineInfoDAO.getLineListByLineIds(lineIdList);
//过滤出已结束的线索 这块线索需要重新生成新的线索
@@ -287,7 +291,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
closeLineList.stream().forEach(x->{
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setPartnerId(x.getPartnerId());
hyPartnerLineInfoDO.setInvestmentManager(user.getUserId());
hyPartnerLineInfoDO.setInvestmentManager(userId);
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
hyPartnerLineInfoDO.setLineStatus(1);
@@ -307,21 +311,21 @@ 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);
hyPartnerLineInfoDAO.updateInvestmentManager(userId, otherLineIdList);
//添加日志
partnerLineInfoList.forEach(x->{
//给招商经理发送飞书工作通知
List<String> userIdList = new ArrayList<>();
userIdList.add(user.getUserId());
userIdList.add(userId);
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(x.getPartnerId());
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
LineLogInfo lineLogInfo = new LineLogInfo(x.getPartnerId(), x.getId(), user.getUserId(),
user.getName(), OperateTypeEnum.ALLOCATION_INVESTMENT_MANAGER,
LineLogInfo lineLogInfo = new LineLogInfo(x.getPartnerId(), x.getId(), operateUser.getUserId(),
operateUser.getName(), OperateTypeEnum.ALLOCATION_INVESTMENT_MANAGER,
WorkflowStageEnum.getWorkflowStageByCode(x.getWorkflowStage()),
x.getWorkflowStatus(), "");
AllocationInvestmentManagerLogDTO logDTO = AllocationInvestmentManagerLogDTO.builder().allocationUserId(user.getUserId()).allocationUsername(user.getName())
AllocationInvestmentManagerLogDTO logDTO = AllocationInvestmentManagerLogDTO.builder().allocationUserId(userId).allocationUsername(user.getName())
.mobile(user.getMobile()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_2)).build();
lineLogInfo.setData(logDTO);
hyPartnerTaskInfoLogDAO.addOperateLog(lineLogInfo);

View File

@@ -189,7 +189,7 @@ public class DeskController {
@ApiOperation("分配招商经理/批量分配招商经理")
public ResponseResult<Boolean> allocationInvestmentManager(@RequestBody AllocationInvestmentManagerRequest request){
return ResponseResult.success(hyPartnerLineInfoService.allocationInvestmentManager(CurrentUserHolder.getUser(),request.getLineIdList()));
return ResponseResult.success(hyPartnerLineInfoService.allocationInvestmentManager(CurrentUserHolder.getUser(),request.getUserId(),request.getLineIdList()));
}