会销报名+取消报名
This commit is contained in:
@@ -18,6 +18,7 @@ public enum FeiShuNoticeMsgEnum {
|
||||
FOLLOW_TASK("线索跟进任务", "{0}", "img_v2_1960b7ef-8c4e-4c3d-8b67-3d918a85578g", "1567d83b966f2d312fd7fcd2e72dbce9"),
|
||||
INTERVIEW_APPOINTMENT("面试预约申请", "您有一个【面试预约申请】待处理,预约人 {0} 手机号 {1} ,预约面试时间 {2} ","img_v2_107bb06b-2a7a-43e1-a6ae-e5d2f2dae17g", "1567d83b966f2d312fd7fcd2e72dbce9"),
|
||||
EXHIBITION_COLLABORATOR("会销协作通知", "{0} 已将您添加为【{1}】的会销协作人,日期为 {2},地点为“{3}” ","img_v2_107bb06b-2a7a-43e1-a6ae-e5d2f2dae17g", "1567d83b966f2d312fd7fcd2e72dbce9"),
|
||||
PARTNER_SIGNUP_EXHIBITION("线索已报名会销", "您跟进的线索客户{0} {1} 已报名于 {2} 举办的【{3}】 ,地点为“{4}”","img_v2_107bb06b-2a7a-43e1-a6ae-e5d2f2dae17g", "1567d83b966f2d312fd7fcd2e72dbce9"),
|
||||
;
|
||||
|
||||
private String title;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/12/11 13:56
|
||||
* @Version 1.0
|
||||
*/
|
||||
public enum SignUpStatusEnum {
|
||||
|
||||
Sign_UP_FAIL_1("会销结束","你报名的展会已结束 请确认!"),
|
||||
Sign_UP_FAIL_2("不符合报名条件","该线索已录入系统但不符合报名要求,当前处于【{0}:{1}】状态,建议客户经理以当前状态正常推进,勿占用展会名额。"),
|
||||
Sign_UP_FAIL_3("报名同一个会销组内会销","线索已报名本批次会销组中的“{0}”场次,切勿重复录入"),
|
||||
Sign_UP_FAIL_4("不符合报名条件—黑名单","该线索已录入系统但不符合报名要求,当前处于【{0}】状态,建议客户经理以当前状态正常推进,勿占用展会名额。");
|
||||
|
||||
private String signUpTitle;
|
||||
private String signUpFailMsg;
|
||||
|
||||
|
||||
SignUpStatusEnum(String signUpTitle, String signUpFailMsg) {
|
||||
this.signUpTitle = signUpTitle;
|
||||
this.signUpFailMsg = signUpFailMsg;
|
||||
}
|
||||
|
||||
public String getSignUpTitle() {
|
||||
return signUpTitle;
|
||||
}
|
||||
|
||||
public String getSignUpFailMsg() {
|
||||
return signUpFailMsg;
|
||||
}
|
||||
|
||||
public static String getSignUpFailMsg(SignUpStatusEnum signUpStatusEnum,Object... objects) {
|
||||
return MessageFormat.format(signUpStatusEnum.getSignUpFailMsg(),objects);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,9 +2,7 @@ package com.cool.store.enums;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -41,6 +39,32 @@ public enum WorkflowStageEnum {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 所有大阶段俞小阶段状态对应
|
||||
* @return
|
||||
*/
|
||||
public static final HashMap<String, List<WorkflowStatusEnum>> getWorkflowStatusMap(){
|
||||
HashMap<String, List<WorkflowStatusEnum>> result = new HashMap<>();
|
||||
result.put(INTENT.getCode(),Arrays.asList(WorkflowStatusEnum.INTENT_0,WorkflowStatusEnum.INTENT_1,WorkflowStatusEnum.INTENT_2,WorkflowStatusEnum.INTENT_3));
|
||||
result.put(RESERVATION.getCode(),Arrays.asList(WorkflowStatusEnum.RESERVATION_0,WorkflowStatusEnum.RESERVATION_1,WorkflowStatusEnum.RESERVATION_7,WorkflowStatusEnum.RESERVATION_8));
|
||||
result.put(INTERVIEW.getCode(),Arrays.asList(WorkflowStatusEnum.INTERVIEW_2,WorkflowStatusEnum.INTERVIEW_3,WorkflowStatusEnum.INTERVIEW_4,
|
||||
WorkflowStatusEnum.INTERVIEW_5,WorkflowStatusEnum.INTERVIEW_6,WorkflowStatusEnum.INTERVIEW_7));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 会销能报名的阶段
|
||||
* @return
|
||||
*/
|
||||
public static final HashMap<String, List<String>> getExhibitionSignUpMap(){
|
||||
HashMap<String, List<String>> map = new HashMap<>();
|
||||
map.put(WorkflowStageEnum.INTENT.getCode(), Arrays.asList(WorkflowStatusEnum.INTENT_0.getCode(),WorkflowStatusEnum.INTENT_1.getCode(),WorkflowStatusEnum.INTENT_2.getCode()));
|
||||
map.put(WorkflowStageEnum.RESERVATION.getCode(),Arrays.asList(WorkflowStatusEnum.RESERVATION_0.getCode()));
|
||||
map.put(WorkflowStageEnum.INTERVIEW.getCode(),new ArrayList<>());
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
|
||||
@@ -14,7 +14,7 @@ public enum WorkflowStatusEnum {
|
||||
|
||||
//预约面试阶段
|
||||
RESERVATION_0("0","待预约"),
|
||||
RESERVATION_1("1","预约时间待审核"),
|
||||
RESERVATION_1("1","待审核"),
|
||||
RESERVATION_7("7","拒绝"),
|
||||
RESERVATION_8("8","超时"),//超时未预约或未参加
|
||||
|
||||
|
||||
@@ -108,4 +108,8 @@ public class HyExhibitionDAO {
|
||||
return hyExhibitionMapper.listByExhibitionGroupIds(exhibitionGroupIdList);
|
||||
}
|
||||
|
||||
public Integer lineSignUpCount(Integer exhibitionGroupId, Long lineId){
|
||||
return hyExhibitionMapper.lineSignUpCount(exhibitionGroupId,lineId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.exhibition.ExhibitionLineBaseDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionLineDTO;
|
||||
import com.cool.store.entity.HyExhibitionDO;
|
||||
import com.cool.store.entity.HyPartnerExhibitionDO;
|
||||
import com.cool.store.entity.HyPartnerExhibitionInterviewDO;
|
||||
import com.cool.store.mapper.HyPartnerExhibitionMapper;
|
||||
@@ -24,7 +25,7 @@ public class HyPartnerExhibitionDAO {
|
||||
HyPartnerExhibitionMapper hyPartnerExhibitionMapper;
|
||||
|
||||
public int insertSelective(HyPartnerExhibitionDO record){
|
||||
if (record.getId() == null){
|
||||
if (record == null){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerExhibitionMapper.insertSelective(record);
|
||||
@@ -129,4 +130,12 @@ public class HyPartnerExhibitionDAO {
|
||||
}
|
||||
return hyPartnerExhibitionMapper.exhibitionLineBaseInfo(partnerName, exhibitionId);
|
||||
}
|
||||
|
||||
public HyPartnerExhibitionDO getPartnerExhibition(Integer exhibitionId, Long lindId){
|
||||
return hyPartnerExhibitionMapper.getPartnerExhibition(exhibitionId,lindId);
|
||||
}
|
||||
|
||||
public Integer partnerSignUpCount(Long lineId){
|
||||
return hyPartnerExhibitionMapper.partnerSignUpCount(lineId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,4 +55,7 @@ public interface HyExhibitionMapper {
|
||||
List<ExhibitionStatisticsDTO> exhibitionStatistic(@Param("list") List<String> exhibitionCodeList);
|
||||
|
||||
List<ExhibitionDTO> listByExhibitionGroupIds(@Param("list") List<Integer> exhibitionGroupIdList);
|
||||
|
||||
Integer lineSignUpCount(@Param("exhibitionGroupId") Integer exhibitionGroupId, @Param("lineId") Long lineId);
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.exhibition.ExhibitionLineBaseDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionLineDTO;
|
||||
import com.cool.store.entity.HyExhibitionDO;
|
||||
import com.cool.store.entity.HyPartnerExhibitionDO;
|
||||
import io.swagger.models.auth.In;
|
||||
import com.cool.store.entity.HyPartnerExhibitionInterviewDO;
|
||||
@@ -94,5 +95,12 @@ public interface HyPartnerExhibitionMapper {
|
||||
|
||||
List<ExhibitionLineBaseDTO> exhibitionLineBaseInfo(@Param("partnerName") String partnerName, @Param("id") Integer id);
|
||||
|
||||
HyPartnerExhibitionDO getPartnerExhibition(@Param("exhibitionId") Integer exhibitionId, @Param("lineId") Long lindId);
|
||||
|
||||
/**
|
||||
* 加盟商报名会销次数(不包括取消报名)
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Integer partnerSignUpCount(@Param("lineId") Long lineId );
|
||||
}
|
||||
@@ -281,6 +281,20 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="lineSignUpCount" resultType="java.lang.Integer">
|
||||
select count(1) from hy_exhibition a left join hy_partner_exhibition b on a.id = b.exhibition_id
|
||||
<where>
|
||||
and b.participation_status!=7
|
||||
<if test="exhibitionGroupId!=null">
|
||||
and a.exhibition_group_id = #{exhibitionGroupId}
|
||||
</if>
|
||||
<if test="lineId!=null">
|
||||
and b.partner_line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exhibitionStatistic" resultType="com.cool.store.dto.exhibition.ExhibitionStatisticsDTO">
|
||||
select
|
||||
exhibition_code as exhibitionCode,
|
||||
|
||||
@@ -432,4 +432,26 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getPartnerExhibition" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from hy_partner_exhibition
|
||||
<where>
|
||||
<if test="exhibitionId!=null">
|
||||
and exhibition_id = #{exhibitionId}
|
||||
</if>
|
||||
<if test="lineId!=null">
|
||||
and partner_line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="partnerSignUpCount" resultType="java.lang.Integer">
|
||||
select count(1) from hy_partner_exhibition a left join hy_exhibition b on a.exhibition_id = b.id
|
||||
where a.participation_status != 7 and b.closed_type!=0
|
||||
<if test="lineId!=null">
|
||||
and a.partner_line_id = #{lineId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -116,7 +116,10 @@
|
||||
SELECT crm_create_time as crmCreateTime FROM hy_partner_user_info ORDER BY crm_create_time desc limit 1
|
||||
</select>
|
||||
<select id="selectByCheckMobile" resultType="com.cool.store.dto.partner.MobileCheckDTO">
|
||||
select a.partner_id as partnerId,a.mobile,line_status as lineStatus ,c.`name`as investmentManager,c.mobile as investmentManagerMobile FROM hy_partner_user_info a left join hy_partner_line_info b on a.partner_id=b.partner_id and b.deleted=0 left join enterprise_user c on b.investment_manager=c.user_id and c.deleted=0 WHERE a.mobile=#{mobile}
|
||||
select a.partner_id as partnerId,a.mobile,a.username as partnerName,
|
||||
b.line_status as lineStatus ,b.workflow_stage as workflowStage ,b.workflow_status as workflowStatus ,close_time as closeTime,b.id as lineId,
|
||||
c.`name`as investmentManager,c.mobile as investmentManagerMobile
|
||||
FROM hy_partner_user_info a left join hy_partner_line_info b on a.partner_id=b.partner_id and b.deleted=0 left join enterprise_user c on b.investment_manager=c.user_id and c.deleted=0 WHERE a.mobile=#{mobile}
|
||||
</select>
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.dto.exhibition;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/12/11 11:11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class SignUpExhibitionDTO {
|
||||
|
||||
private String partnerName;
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String wantShopArea;
|
||||
|
||||
private String intendedAccountManager;
|
||||
|
||||
private Integer exhibitionId;
|
||||
|
||||
private Integer expectedVisitorsCount;
|
||||
|
||||
private String expectedInformation;
|
||||
}
|
||||
@@ -14,7 +14,12 @@ public class MobileCheckDTO {
|
||||
private String partnerId;
|
||||
private String mobile;
|
||||
private Integer lineStatus;
|
||||
private String workflowStage;
|
||||
private String workflowStatus;
|
||||
private String closeTime;
|
||||
private String investmentManager;
|
||||
private Long lineId;
|
||||
private String partnerName;
|
||||
|
||||
private String investmentManagerMobile;
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.cool.store.vo.exhibition;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/12/11 11:09
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class SignUpExhibitionVO {
|
||||
|
||||
private Boolean signUpStatus;
|
||||
|
||||
private Integer signUpFailCode;
|
||||
|
||||
private String signUpFailMsg;
|
||||
|
||||
public SignUpExhibitionVO(Boolean signUpStatus, Integer signUpFailCode,String signUpFailMsg) {
|
||||
this.signUpStatus = signUpStatus;
|
||||
this.signUpFailCode = signUpFailCode;
|
||||
this.signUpFailMsg = signUpFailMsg;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.exhibition.ExhibitionDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionEnterInterviewDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionGroupDTO;
|
||||
import com.cool.store.dto.exhibition.SignUpExhibitionDTO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import com.cool.store.vo.exhibition.*;
|
||||
@@ -101,4 +102,14 @@ public interface ExhibitionService {
|
||||
|
||||
List<ExhibitionLineBaseVO> exhibitionLineBaseList(Integer exhibitionId,String partnerName);
|
||||
|
||||
/**
|
||||
* 报名会销
|
||||
* @param signUpExhibitionDTO
|
||||
* @param userInfo
|
||||
* @return
|
||||
*/
|
||||
SignUpExhibitionVO signUpExhibition(SignUpExhibitionDTO signUpExhibitionDTO,LoginUserInfo userInfo) throws ApiException;
|
||||
|
||||
Boolean cancelSignUpExhibition(Integer exhibitionId,Long lineId,LoginUserInfo userInfo);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.exhibition.*;
|
||||
import com.cool.store.dto.partner.LineInterviewDTO;
|
||||
import com.cool.store.dto.partner.MobileCheckDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ApiException;
|
||||
@@ -23,6 +24,7 @@ import com.cool.store.service.InterviewService;
|
||||
import com.cool.store.service.WechatMiniAppService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.TRTCUtils;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
@@ -33,6 +35,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -40,6 +43,7 @@ import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -78,6 +82,11 @@ public class ExhibitionServiceImpl implements ExhibitionService {
|
||||
@Autowired
|
||||
private TRTCUtils trtcUtils;
|
||||
|
||||
@Resource
|
||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
// @Value("${offline.exhibition.channel.id}")
|
||||
// private Integer offlineExhibition;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public EnterInterviewVO startExhibitionInterview(ExhibitionEnterInterviewDTO dto) throws ApiException {
|
||||
@@ -487,6 +496,175 @@ public class ExhibitionServiceImpl implements ExhibitionService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SignUpExhibitionVO signUpExhibition(SignUpExhibitionDTO signUpExhibitionDTO, LoginUserInfo userInfo) throws ApiException {
|
||||
//报名会销
|
||||
if (signUpExhibitionDTO.getExhibitionId() == null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
HyExhibitionDO hyExhibitionDO = hyExhibitionDAO.selectByPrimaryKey(signUpExhibitionDTO.getExhibitionId());
|
||||
if (hyExhibitionDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.EXHIBITION_NOT_EXIST);
|
||||
}
|
||||
//先判断会销是否结束 已结束不能报名
|
||||
if(hyExhibitionDO.getClosedType()!=0){
|
||||
return new SignUpExhibitionVO(Boolean.FALSE,CommonConstants.ONE,SignUpStatusEnum.getSignUpFailMsg(SignUpStatusEnum.Sign_UP_FAIL_1));
|
||||
}
|
||||
//是否存在线索
|
||||
//查询线索信息
|
||||
MobileCheckDTO mobileCheckDTO = hyPartnerUserInfoDAO.selectByCheckMobile(signUpExhibitionDTO.getMobile());
|
||||
//线索不存在
|
||||
Boolean sendNotice = Boolean.TRUE;
|
||||
String investManager = mobileCheckDTO.getInvestmentManager();
|
||||
String partnerId = mobileCheckDTO.getPartnerId();
|
||||
Long lineId = mobileCheckDTO.getLineId();
|
||||
if (mobileCheckDTO == null||mobileCheckDTO.getLineStatus() == null){
|
||||
//走这里不需要发送通知
|
||||
sendNotice = Boolean.FALSE;
|
||||
//mobileCheckDTO为空 表示从没有授权过 mobileCheckDTO不为空 但是线索状态为空 表示授权过 但是没有线索
|
||||
if (mobileCheckDTO==null){
|
||||
partnerId = UUIDUtils.get32UUID();
|
||||
HyPartnerUserInfoDO resultUser = new HyPartnerUserInfoDO();
|
||||
resultUser.setUsername(signUpExhibitionDTO.getPartnerName()).setMobile(signUpExhibitionDTO.getMobile()).setPartnerId(partnerId).setCreateTime(new Date())
|
||||
.setWantShopArea(signUpExhibitionDTO.getWantShopArea()).setUserChannelId(111111111);
|
||||
hyPartnerUserInfoDAO.insertSelective(resultUser);
|
||||
}
|
||||
HyPartnerLineInfoDO resultLine = new HyPartnerLineInfoDO();
|
||||
resultLine.setPartnerId(partnerId).setCreateTime(new Date()).setWorkflowStage(WorkflowStageEnum.INTENT.getCode())
|
||||
.setCreateUserId(CurrentUserHolder.getUserId()).setCreateUserMobile(CurrentUserHolder.getUser().getMobile())
|
||||
.setOperatorType("add").setAllotTime(new Date()).setLineStatus(LineStatusEnum.PRIVATE_SEAS.getCode()).setInvestmentManager(hyExhibitionDO.getCreator());
|
||||
hyPartnerLineInfoDAO.insertSelective(resultLine);
|
||||
lineId = resultLine.getId();
|
||||
}
|
||||
//如果是公海状态 但是结束时间不为空
|
||||
if (LineStatusEnum.PUBLIC_SEAS.getCode().equals(mobileCheckDTO.getLineStatus())){
|
||||
//不管冷静期有没有结束 会销创建人直接认领改线索
|
||||
//发送工作通知的招商经理
|
||||
investManager = hyExhibitionDO.getCreator();
|
||||
if(mobileCheckDTO.getCloseTime()!=null){
|
||||
//将老的线索置为删除状态
|
||||
hyPartnerLineInfoDAO.batchDeleted(Arrays.asList(Long.valueOf(lineId)));
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
hyPartnerLineInfoDO.setPartnerId(partnerId);
|
||||
//给会销创建人
|
||||
hyPartnerLineInfoDO.setInvestmentManager(hyExhibitionDO.getCreator());
|
||||
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
|
||||
hyPartnerLineInfoDO.setLineStatus(1);
|
||||
hyPartnerLineInfoDO.setAllotTime(new Date());
|
||||
hyPartnerLineInfoDAO.insertSelective(hyPartnerLineInfoDO);
|
||||
lineId = hyPartnerLineInfoDO.getId();
|
||||
}else{
|
||||
//如果首次在私海 直接分配会销创建人为线索招商经理
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
hyPartnerLineInfoDO.setId(Long.valueOf(lineId));
|
||||
hyPartnerLineInfoDO.setAllotTime(new Date());
|
||||
hyPartnerLineInfoDO.setLineStatus(LineStatusEnum.PRIVATE_SEAS.getCode());
|
||||
hyPartnerLineInfoDO.setInvestmentManager(hyExhibitionDO.getCreator());
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
}
|
||||
SignUpExhibitionVO signUpExhibitionVO = checkSignUp(mobileCheckDTO);
|
||||
if (signUpExhibitionVO!=null){
|
||||
return signUpExhibitionVO;
|
||||
}
|
||||
//是否重复报名
|
||||
Integer exhibitionGroupId = hyExhibitionDO.getExhibitionGroupId();
|
||||
Integer count = hyExhibitionDAO.lineSignUpCount(exhibitionGroupId, lineId);
|
||||
if (count > 0){
|
||||
HyExhibitionGroupDO hyExhibitionGroupDO = hyExhibitionGroupDAO.selectByPrimaryKey(exhibitionGroupId);
|
||||
return new SignUpExhibitionVO(Boolean.FALSE,CommonConstants.THREE,SignUpStatusEnum.getSignUpFailMsg(SignUpStatusEnum.Sign_UP_FAIL_3,hyExhibitionGroupDO.getExhibitionGroupName()));
|
||||
}
|
||||
//开始报名
|
||||
//判断是否之前报名过改会销
|
||||
HyPartnerExhibitionDO partnerExhibition = hyPartnerExhibitionDAO.getPartnerExhibition(hyExhibitionDO.getId(), lineId);
|
||||
if (partnerExhibition != null){
|
||||
partnerExhibition.setParticipationStatus(ExhibitionPartnerStatus.REGISTERED.getCode());
|
||||
partnerExhibition.setWantShopArea(signUpExhibitionDTO.getWantShopArea());
|
||||
partnerExhibition.setInvestmentManagerName(signUpExhibitionDTO.getIntendedAccountManager());
|
||||
partnerExhibition.setExpectedVisitorsCount(signUpExhibitionDTO.getExpectedVisitorsCount());
|
||||
partnerExhibition.setExpectedInformation(signUpExhibitionDTO.getExpectedInformation());
|
||||
hyPartnerExhibitionDAO.updateByPrimaryKeySelective(partnerExhibition);
|
||||
}else {
|
||||
HyPartnerExhibitionDO hyPartnerExhibitionDO = new HyPartnerExhibitionDO();
|
||||
hyPartnerExhibitionDO.setExhibitionId(signUpExhibitionDTO.getExhibitionId());
|
||||
hyPartnerExhibitionDO.setPartnerLineId(lineId);
|
||||
hyPartnerExhibitionDO.setPartnerId(partnerId);
|
||||
hyPartnerExhibitionDO.setWantShopArea(signUpExhibitionDTO.getWantShopArea());
|
||||
hyPartnerExhibitionDO.setInvestmentManagerName(signUpExhibitionDTO.getIntendedAccountManager());
|
||||
hyPartnerExhibitionDO.setExpectedVisitorsCount(signUpExhibitionDTO.getExpectedVisitorsCount());
|
||||
hyPartnerExhibitionDO.setExpectedInformation(signUpExhibitionDTO.getExpectedInformation());
|
||||
hyPartnerExhibitionDO.setParticipationStatus(ExhibitionPartnerStatus.REGISTERED.getCode());
|
||||
hyPartnerExhibitionDO.setCreator(userInfo.getUserId());
|
||||
hyPartnerExhibitionDAO.insertSelective(hyPartnerExhibitionDO);
|
||||
}
|
||||
//计算是否会销中
|
||||
whetherInExhibition(lineId,Boolean.TRUE);
|
||||
if (sendNotice){
|
||||
//发送通知
|
||||
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.PARTNER_SIGNUP_EXHIBITION,Arrays.asList(investManager),mobileCheckDTO.getPartnerName(),mobileCheckDTO.getMobile(),
|
||||
DateUtils.format(hyExhibitionDO.getStartDate(),CoolDateUtils.DATE_FORMAT_DAY_2),hyExhibitionDO.getExhibitionName(),hyExhibitionDO.getLocation());
|
||||
}
|
||||
return new SignUpExhibitionVO(Boolean.TRUE,CommonConstants.ZERO,null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean cancelSignUpExhibition(Integer exhibitionId,Long lineId,LoginUserInfo userInfo) {
|
||||
if (exhibitionId == null || lineId == null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//取消报名
|
||||
HyPartnerExhibitionDO partnerExhibition = hyPartnerExhibitionDAO.getPartnerExhibition(exhibitionId, lineId);
|
||||
partnerExhibition.setParticipationStatus(ExhibitionPartnerStatus.SIGN_CANCELED.getCode());
|
||||
partnerExhibition.setUpdater(userInfo.getUserId());
|
||||
hyPartnerExhibitionDAO.updateByPrimaryKeySelective(partnerExhibition);
|
||||
//计算是否会销中
|
||||
whetherInExhibition(lineId,Boolean.FALSE);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算是否会销中
|
||||
* @param lineId
|
||||
*/
|
||||
private void whetherInExhibition(Long lineId,Boolean insertFlag){
|
||||
//计算是否会销中(报名了会销(不能是取消报名状态) 且会销属于开发中 )
|
||||
Integer count = hyPartnerExhibitionDAO.partnerSignUpCount(lineId);
|
||||
log.info("partnerSignUpCount:{}",count);
|
||||
//会销状态
|
||||
Boolean exhibitionStatus = (count>CommonConstants.ZERO||insertFlag)?Boolean.TRUE:Boolean.FALSE;
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
hyPartnerLineInfoDO.setId(lineId);
|
||||
hyPartnerLineInfoDO.setWhetherInExhibition(exhibitionStatus);
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验报名
|
||||
* @param mobileCheckDTO
|
||||
* @return
|
||||
*/
|
||||
private SignUpExhibitionVO checkSignUp(MobileCheckDTO mobileCheckDTO){
|
||||
//黑名单
|
||||
if (LineStatusEnum.BLACKLIST.getCode().equals(mobileCheckDTO.getLineStatus())){
|
||||
return new SignUpExhibitionVO(Boolean.FALSE,CommonConstants.TWO,SignUpStatusEnum.getSignUpFailMsg(SignUpStatusEnum.Sign_UP_FAIL_4));
|
||||
}
|
||||
//私海
|
||||
//能报名的列表
|
||||
Map<String,List<String>> map = WorkflowStageEnum.getExhibitionSignUpMap();
|
||||
if (LineStatusEnum.PRIVATE_SEAS.getCode().equals(mobileCheckDTO.getLineStatus())){
|
||||
List<String> list = map.get(mobileCheckDTO.getWorkflowStage());
|
||||
if (!list.contains(mobileCheckDTO.getWorkflowStatus())){
|
||||
HashMap<String, List<WorkflowStatusEnum>> workflowStatusMap = WorkflowStageEnum.getWorkflowStatusMap();
|
||||
List<WorkflowStatusEnum> workflowStatusEnums = workflowStatusMap.get(mobileCheckDTO.getWorkflowStage());
|
||||
Map<String, String> statusMap = workflowStatusEnums.stream().collect(Collectors.toMap(WorkflowStatusEnum::getCode, WorkflowStatusEnum::getMessage, (a, b) -> b));
|
||||
return new SignUpExhibitionVO(Boolean.FALSE,CommonConstants.TWO,SignUpStatusEnum.getSignUpFailMsg(SignUpStatusEnum.Sign_UP_FAIL_2,
|
||||
WorkflowStageEnum.getWorkflowStageByCode(mobileCheckDTO.getWorkflowStage()).getMessage(),statusMap.get(mobileCheckDTO.getWorkflowStatus())));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 协作人处理
|
||||
|
||||
@@ -5,10 +5,12 @@ import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.exhibition.ExhibitionDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionEnterInterviewDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionGroupDTO;
|
||||
import com.cool.store.dto.exhibition.SignUpExhibitionDTO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ExhibitionService;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import com.cool.store.vo.exhibition.SignUpExhibitionVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -106,4 +108,19 @@ public class ExhibitionController {
|
||||
return ResponseResult.success(exhibitionService.exhibitionLineBaseList(exhibitionId,partnerName));
|
||||
}
|
||||
|
||||
@ApiOperation("报名会销")
|
||||
@PostMapping("/signUpExhibition")
|
||||
public ResponseResult<SignUpExhibitionVO> signUpExhibition(@RequestBody SignUpExhibitionDTO dto) throws ApiException {
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(exhibitionService.signUpExhibition(dto,user));
|
||||
}
|
||||
|
||||
@ApiOperation("取消报名会销")
|
||||
@GetMapping("/cancelSignUp")
|
||||
public ResponseResult<Boolean> cancelSignUp(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId,
|
||||
@RequestParam(required = true,value = "lineId") Long lineId) throws ApiException {
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(exhibitionService.cancelSignUpExhibition(exhibitionId,lineId,user));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.exhibition.SignUpExhibitionDTO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ExhibitionService;
|
||||
import com.cool.store.vo.exhibition.SignUpExhibitionVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/12/12 18:00
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("exhibition")
|
||||
@Api(tags = "会销")
|
||||
@Slf4j
|
||||
public class ExhibitionController {
|
||||
|
||||
@Resource
|
||||
ExhibitionService exhibitionService;
|
||||
|
||||
|
||||
@ApiOperation("报名会销")
|
||||
@PostMapping("/signUpExhibition")
|
||||
public ResponseResult<SignUpExhibitionVO> signUpExhibition(@RequestBody SignUpExhibitionDTO dto) throws ApiException {
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(exhibitionService.signUpExhibition(dto,user));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user