Merge branch 'cc_partner_init' of http://gitlab.coolcollege.cn/hangzhou/java/custom_xfsg into cc_partner_init
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.request.AddTagsRequest;
|
||||
import com.cool.store.request.LineListRequest;
|
||||
import com.cool.store.vo.LineInfoVO;
|
||||
import com.cool.store.vo.LineListVO;
|
||||
@@ -31,4 +32,12 @@ public interface LineService {
|
||||
PageInfo<LineListVO> getLineList(LineListRequest lineListRequest, LoginUserInfo loginUserInfo,Boolean teamFlag);
|
||||
|
||||
|
||||
/**
|
||||
* 添加标签
|
||||
* @param userInfo
|
||||
* @param addTagsRequest
|
||||
* @return
|
||||
*/
|
||||
Boolean addTags(LoginUserInfo userInfo, AddTagsRequest addTagsRequest);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.vo.oss.OssUploadConfigVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/3/28 14:27
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface OSSService {
|
||||
/**
|
||||
* 上传文件
|
||||
* @return
|
||||
*/
|
||||
OssUploadConfigVO getUploadFileConfig();
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
|
||||
}
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_60.getCode());
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
|
||||
return Boolean.TRUE;
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.MemberQuestionDO;
|
||||
import com.cool.store.entity.PartnerBaseInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
||||
import com.cool.store.mapper.JoinIntentionMapper;
|
||||
@@ -39,7 +37,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
JoinIntentionMapper joinIntentionMapper;
|
||||
|
||||
@Resource
|
||||
LineInfoMapper lineInfoMapper;
|
||||
LineInfoDAO lineInfoDAO;
|
||||
|
||||
@Resource
|
||||
HyOpenAreaInfoMapper openAreaInfoMapper;
|
||||
@@ -60,7 +58,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
}
|
||||
//todo 目前写死为进入私海
|
||||
lineInfoParam.setLineStatus(1);
|
||||
lineInfoMapper.insertOrUpdate(lineInfoParam);
|
||||
lineInfoDAO.insertOrUpdate(lineInfoParam);
|
||||
|
||||
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
|
||||
memberQuestionDO.setLineId(lineInfoParam.getId());
|
||||
@@ -78,24 +76,31 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo) {
|
||||
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
|
||||
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
|
||||
Integer nextStageInitStatus = nextStage.getInitStatus().getCode();
|
||||
return null;
|
||||
lineInfo.setWorkflowSubStage(nextStage.getCode());
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INVITING_INTERVIEWS_10.getCode());
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo) {
|
||||
return null;
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_7.getCode());
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo) {
|
||||
return null;
|
||||
lineInfo.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerBaseInfoVO getByLineId(Long lineId) {
|
||||
MemberQuestionDO result = joinIntentionMapper.getByLineId(lineId);
|
||||
LineInfoDO byLineId = lineInfoMapper.getByLineId(lineId);
|
||||
LineInfoDO byLineId = lineInfoDAO.getLineInfo(lineId);
|
||||
if (Objects.isNull(result)) {
|
||||
throw new ServiceException(LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
|
||||
@@ -1,32 +1,38 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.HyPartnerUserChannelDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.entity.HyPartnerLabelDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.OperateTypeEnum;
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.cool.store.request.AddTagsRequest;
|
||||
import com.cool.store.request.LineListRequest;
|
||||
import com.cool.store.service.DeskService;
|
||||
import com.cool.store.service.LineService;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.vo.BaseInfoVO;
|
||||
import com.cool.store.vo.LineInfoVO;
|
||||
import com.cool.store.vo.LineListVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -47,6 +53,10 @@ public class LineServiceImpl implements LineService {
|
||||
HyPartnerUserChannelDAO hyPartnerUserChannelDAO;
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
RegionService regionService;
|
||||
@Resource
|
||||
RegionDao regionDao;
|
||||
|
||||
@Override
|
||||
public LineInfoVO getLineInfo(Long lineId) {
|
||||
@@ -56,6 +66,28 @@ public class LineServiceImpl implements LineService {
|
||||
if (lineInfo==null){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
if (lineInfo.getLineSource()!=null){
|
||||
Map<Integer, String> channelMapByIds = hyPartnerUserChannelDAO.getChannelMapByIds(Arrays.asList(lineInfo.getLineSource()));
|
||||
result.setLineSourceName(channelMapByIds.get(lineInfo.getLineSource()));
|
||||
}
|
||||
if (StringUtil.isNotEmpty(lineInfo.getInvestmentManager())){
|
||||
EnterpriseUserDO user = enterpriseUserDAO.getUserInfoById(lineInfo.getInvestmentManager());
|
||||
result.setInvestmentManagerName(user.getName());
|
||||
result.setInvestmentManagerMobile(user.getMobile());
|
||||
}
|
||||
if(lineInfo.getRegionId()!=null){
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(lineInfo.getWantShopAreaId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, lineInfo.getRegionId()));
|
||||
result.setRegionId(lineInfo.getRegionId());
|
||||
result.setRegionName(regionNameMap.get(lineInfo.getRegionId()));
|
||||
result.setLargeRegionId(bigRegionIdByAreaId);
|
||||
result.setLargeRegionName(regionNameMap.get(bigRegionIdByAreaId));
|
||||
}
|
||||
Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(Arrays.asList(lineInfo));
|
||||
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(Arrays.asList(lineInfo.getWantShopAreaId()));
|
||||
BaseInfoVO baseInfoVO = deskService.convertToBaseInfoVO(lineInfo, userPortraitMap, wantShopAreaMap);
|
||||
result.setWantShopAreaName(baseInfoVO.getWantShopAreaName());
|
||||
result.setUserPortraitList(baseInfoVO.getUserPortraitList());
|
||||
BeanUtil.copyProperties(lineInfo,result);
|
||||
return result;
|
||||
}
|
||||
@@ -90,4 +122,18 @@ public class LineServiceImpl implements LineService {
|
||||
page.setList(result);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addTags(LoginUserInfo user, AddTagsRequest addTagsRequest) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(addTagsRequest.getLineId());
|
||||
if (lineInfo==null){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
|
||||
lineInfo.setUserPortrait(CollectionUtils.isNotEmpty(addTagsRequest.getTags())?
|
||||
addTagsRequest.getTags().stream().map(Object::toString).collect(Collectors.joining(CommonConstants.COMMA, CommonConstants.COMMA, CommonConstants.COMMA)):"");
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.aliyun.oss.OSS;
|
||||
import com.aliyun.oss.OSSClientBuilder;
|
||||
import com.aliyun.oss.common.utils.BinaryUtil;
|
||||
import com.aliyun.oss.model.MatchMode;
|
||||
import com.aliyun.oss.model.PolicyConditions;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.OSSService;
|
||||
import com.cool.store.vo.oss.OssUploadConfigVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/3/28 14:29
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class OSSServiceImpl implements OSSService {
|
||||
|
||||
@Value("${oss.accessKeyId:null}")
|
||||
private String accessKeyId;
|
||||
@Value("${oss.accessKeySecret:null}")
|
||||
private String accessKeySecret;
|
||||
@Value("${oss.endpoint:null}")
|
||||
private String endpoint;
|
||||
@Value("${oss.bucket:null}")
|
||||
private String bucket;
|
||||
@Value("${cdn.url:null}")
|
||||
private String cdnUrl;
|
||||
@Value("${oss.file.dir:null}")
|
||||
private String dir;
|
||||
|
||||
@Override
|
||||
public OssUploadConfigVO getUploadFileConfig() {
|
||||
// host的格式为 bucketname.endpoint
|
||||
String host = "https://" + bucket + "." + endpoint;
|
||||
OSS client = null;
|
||||
try {
|
||||
client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
||||
long expireTime = 300;
|
||||
long expireEndTime = System.currentTimeMillis() + expireTime * 1000;
|
||||
Date expiration = new Date(expireEndTime);
|
||||
PolicyConditions policyConds = new PolicyConditions();
|
||||
policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 1048576000);
|
||||
policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, dir);
|
||||
String postPolicy = client.generatePostPolicy(expiration, policyConds);
|
||||
byte[] binaryData = postPolicy.getBytes("utf-8");
|
||||
String encodedPolicy = BinaryUtil.toBase64String(binaryData);
|
||||
String signature = client.calculatePostSignature(postPolicy);
|
||||
OssUploadConfigVO result = new OssUploadConfigVO(accessKeyId, encodedPolicy, signature, dir, host, String.valueOf(expireEndTime / 1000), cdnUrl);
|
||||
return result;
|
||||
}catch (Exception e){
|
||||
log.info("exception", e);
|
||||
throw new ServiceException(ErrorCodeEnum.GET_INFO_ERROR);
|
||||
}finally {
|
||||
if(Objects.nonNull(client)){
|
||||
client.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.entity.LeaseBaseInfoDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.ExperienceStatusEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
@@ -31,6 +32,7 @@ public class TrainingExperienceServiceImpl implements TrainingExperienceService
|
||||
LineInfoMapper lineInfoMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean distribution(TrainingExperienceDistributionRequest request) {
|
||||
if (Objects.isNull(request)) {
|
||||
return Boolean.FALSE;
|
||||
@@ -38,7 +40,12 @@ public class TrainingExperienceServiceImpl implements TrainingExperienceService
|
||||
if (Objects.isNull(request.getLineId())) {
|
||||
throw new ServiceException(INTERVIEW_LINE_ID_IS_NULL);
|
||||
}
|
||||
trainingExperienceMapper.insert(request.toLeaseBaseInfoDO());
|
||||
LeaseBaseInfoDO leaseBaseInfoDO = request.toLeaseBaseInfoDO();
|
||||
trainingExperienceMapper.insert(leaseBaseInfoDO);
|
||||
LineInfoDO lineInfoDO = new LineInfoDO();
|
||||
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.SIGN_INTENT_AGREEMENT.getCode());
|
||||
lineInfoDO.setId(request.getLineId());
|
||||
lineInfoMapper.updateByPrimaryKey(lineInfoDO);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user