|
|
|
|
@@ -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);
|
|
|
|
|
|