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

This commit is contained in:
zhangchenbiao
2023-08-23 17:42:09 +08:00
10 changed files with 71 additions and 32 deletions

View File

@@ -6,6 +6,7 @@ import com.cool.store.dto.outbound.DeleteNumberDTO;
import com.cool.store.dto.outbound.OutboundListDTO;
import com.cool.store.dto.outbound.UpdateNumberDTO;
import com.cool.store.entity.HyOutboundMobileDO;
import com.cool.store.entity.HyPartnerLabelGroupDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyOutboundMobileMapper;
@@ -14,6 +15,7 @@ import com.cool.store.vo.HyOutboundVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
@@ -41,12 +43,12 @@ public class HyOutboundServiceImpl implements HyOutboundService {
*/
@Override
public void addOutboundNumber(AddNumberDTO dto) throws ApiException {
if (whetherRepeat(dto.getOutboundNumber())) {
HyOutboundMobileDO hyOutboundMobile = new HyOutboundMobileDO();
hyOutboundMobile.setMobile(dto.getOutboundNumber());
if (whetherRepeat(hyOutboundMobile)) {
throw new ApiException(ErrorCodeEnum.OUTBOUND_NUMBER_EXIST);
}
String userId = CurrentUserHolder.getUserId();
HyOutboundMobileDO hyOutboundMobile = new HyOutboundMobileDO();
hyOutboundMobile.setMobile(dto.getOutboundNumber());
hyOutboundMobile.setEditUserId(userId);
hyOutboundMobile.setCreateUserId(userId);
hyOutboundMobile.setUpdateUserId(userId);
@@ -59,15 +61,16 @@ public class HyOutboundServiceImpl implements HyOutboundService {
*/
@Override
public void updateOutboundNumber(UpdateNumberDTO dto) throws ApiException {
if (whetherRepeat(dto.getNewOutboundNumber())) {
throw new ApiException(ErrorCodeEnum.OUTBOUND_NUMBER_EXIST);
}
String userId = CurrentUserHolder.getUserId();
HyOutboundMobileDO hyOutboundMobile = new HyOutboundMobileDO();
hyOutboundMobile.setId(dto.getId());
hyOutboundMobile.setMobile(dto.getNewOutboundNumber());
if (whetherRepeat(hyOutboundMobile)) {
throw new ApiException(ErrorCodeEnum.OUTBOUND_NUMBER_EXIST);
}
String userId = CurrentUserHolder.getUserId();
hyOutboundMobile.setEditUserId(userId);
hyOutboundMobile.setUpdateUserId(userId);
hyOutboundMobile.setUpdateTime(new Date());
outboundMobileMapper.updateByPrimaryKeySelective(hyOutboundMobile);
}
@@ -87,14 +90,23 @@ public class HyOutboundServiceImpl implements HyOutboundService {
/**
* 查询某个手机号是否重复
* @param number 手机号
* @param hyOutboundMobileDO 手机号信息
* @return 是否重复
*/
public boolean whetherRepeat(String number) {
HyOutboundMobileDO hyOutboundMobileDO = new HyOutboundMobileDO();
hyOutboundMobileDO.setMobile(number);
public boolean whetherRepeat(HyOutboundMobileDO hyOutboundMobileDO) {
Long id = hyOutboundMobileDO.getId();
hyOutboundMobileDO.setId(null);
List<HyOutboundMobileDO> outboundMobileList = outboundMobileMapper.selectByPrimarySelective(hyOutboundMobileDO);
return outboundMobileList != null && outboundMobileList.size() != 0;
hyOutboundMobileDO.setId(id);
//如果修改后的号码与原号码一致也不算重复,但是要记录更新人
if (outboundMobileList != null && outboundMobileList.size() > 0) {
//更新操作还要检查是否与原号码信息相同,相同的话也不算重复
if (outboundMobileList.get(0).getId().equals(id)) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
return Boolean.FALSE;
}
}

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

@@ -5,6 +5,7 @@ import com.cool.store.dto.label.LabelGroupAddDTO;
import com.cool.store.dto.label.LabelGroupDeleteDTO;
import com.cool.store.dto.label.LabelGroupListDTO;
import com.cool.store.dto.label.LabelGroupUpdateDTO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.entity.HyPartnerLabelGroupDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
@@ -70,6 +71,7 @@ public class LabelGroupServiceImpl implements LabelGroupService {
public void updateLabelGroup(LabelGroupUpdateDTO dto) throws ApiException {
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
labelGroupDO.setLabelGroupName(dto.getLabelGroupName());
labelGroupDO.setId(dto.getId());
if (whetherGroupDuplicated(labelGroupDO)) {
throw new ApiException(ErrorCodeEnum.LABEL_GROUP_EXIST);
}
@@ -117,8 +119,19 @@ public class LabelGroupServiceImpl implements LabelGroupService {
}
private Boolean whetherGroupDuplicated(HyPartnerLabelGroupDO labelGroupDO) {
Long id = labelGroupDO.getId();
labelGroupDO.setId(null);
List<HyPartnerLabelGroupDO> hyPartnerLabelGroupDOS = labelGroupMapper.selectSelective(labelGroupDO);
return hyPartnerLabelGroupDOS != null && hyPartnerLabelGroupDOS.size() > 0;
labelGroupDO.setId(id);
//如果修改后的标签组名与原标签组名一致也不算重复,但是要记录更新人
if (hyPartnerLabelGroupDOS != null && hyPartnerLabelGroupDOS.size() > 0) {
//更新操作还要检查是否与原标签组信息相同,相同的话也不算重复
if (hyPartnerLabelGroupDOS.get(0).getId().equals(id)) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
return Boolean.FALSE;
}
}

View File

@@ -69,12 +69,12 @@ public class LabelServiceImpl implements LabelService {
@Override
public void updateLabel(LabelUpdateDTO dto) throws ApiException {
HyPartnerLabelDO labelDO = new HyPartnerLabelDO();
labelDO.setId(dto.getId());
labelDO.setLabelName(dto.getLabelName());
if (whetherLabelRepeat(labelDO)) {
throw new ApiException(ErrorCodeEnum.LABEL_EXIST);
}
String userId = CurrentUserHolder.getUserId();
labelDO.setId(dto.getId());
labelDO.setLabelGroupId(dto.getLabelGroupId());
labelDO.setEditUserId(userId);
labelDO.setEditDate(new Date());
@@ -99,8 +99,16 @@ public class LabelServiceImpl implements LabelService {
}
private Boolean whetherLabelRepeat(HyPartnerLabelDO label) throws ApiException {
Long id = label.getId();
label.setId(null);
List<HyPartnerLabelDO> hyPartnerLabelDOS = labelMapper.selectSelective(label);
label.setId(id);
//如果修改后的标签名与原标签名一致也不算重复,但是要记录更新人
if (hyPartnerLabelDOS != null && hyPartnerLabelDOS.size() > 0) {
//更新操作还要检查是否与原标签信息相同,相同的话也不算重复
if (hyPartnerLabelDOS.get(0).getId().equals(id)) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -139,7 +147,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);
}