Merge branch 'dev/feat/partner1.6_20231226' into pre

# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/config/redis/RedisUtilConfig.java
This commit is contained in:
feng.li
2023-12-13 15:20:50 +08:00
87 changed files with 4223 additions and 245 deletions

View File

@@ -81,6 +81,7 @@ public class CommonConstants {
public static final long ZERO_LONG = 0L;
public static final int MINUS_ONE = -1;
public static final int ZERO = 0;
public static final int ONE = 1;
public static final int TWO = 2;
@@ -105,6 +106,8 @@ public class CommonConstants {
public static final int ONE_THOUSAND = 1000;
public static final int FIFTY_FIVE = 55;
public static final int SIXTY_FIVE = 65;
public static final int MIN_CODE = 10000000;
public static final int MAX_CODE = 89999999;
public static final String ONE_STR = "1";
@@ -121,6 +124,12 @@ public class CommonConstants {
public static final String FOLLOW = "follow";
public static final String PENDING = "pending";
public static final String CLOSE = "close";
public static final String OPEN = "open";
public static final String ALLOCATION = "allocation";
public static final String TRANSFER = "transfer";

View File

@@ -257,4 +257,10 @@ public class RedisConstant {
* 动态标题
*/
public static final String CONTENT_TITLES = "content:titles";
/**
* 用户预约面试锁
*/
public static final String PARTNER_APPOINTMENT_LOCK = "partner:appointment:lock:{0}";
}

View File

@@ -119,6 +119,16 @@ public enum ErrorCodeEnum {
LABEL_GROUP_IN_USE(120001, "该标签组下存在标签不可删除请确保该标签组下标签数量为0后再进行删除", null),
LABEL_GROUP_EXIST(120002, "该标签组已存在,请重新输入", null),
LABEL_EXIST(120003, "该标签已存在,请重新输入", null),
//会销相关异常 106*** 106开头
EXHIBITION_GROUP_NOT_NULL(106001, "会销组中必须添加至少一个会销", null),
EXHIBITION_GROUP_NOT_EXIST(106002, "会销组不存在或被删除", null),
EXHIBITION_NOT_EXIST(106003, "会销不存在或被删除", null),
EXHIBITION_NOT_SIGNED(106004, "线索未进行会销签到", null),
EXHIBITION_NOT_SUBMIT_INTENTION(106005, "线索未提交意向申请", null),
EXHIBITION_LINE_INTERVIEWED(106006, "线索已预约面试", null),
;

View File

@@ -0,0 +1,36 @@
package com.cool.store.enums;
/**
* @author Fun Li 2023/12/6 13:48
* @version 1.0
*/
public enum ExhibitionPartnerStatus {
REGISTERED(0, "已报名"),
SIGNED(1, "已签到"),
APPLIED(2, "已提交意向申请"),
INTERVIEWING(3, "面试中"),
INTERVIEWED(4, "面试完成"),
INTERVIEW_PASS(5, "面试通过"),
INTERVIEW_REJECT(6, "面试不通过"),
SIGN_CANCELED(7, "取消报名")
;
private Integer code;
private String status;
ExhibitionPartnerStatus(Integer code, String status) {
this.code = code;
this.status = status;
}
public Integer getCode() {
return code;
}
public String getStatus() {
return status;
}
}

View File

@@ -17,6 +17,8 @@ public enum FeiShuNoticeMsgEnum {
INTENTION_APPLY("加盟意向申请", "您有一个【加盟意向申请】待审核,申请人 {0} 手机号 {1} 于 {2} 提交加盟意向申请,请及时处理", "img_v2_c909097d-67d1-4c11-a911-a2584b67ca6g", "1567d83b966f2d312fd7fcd2e72dbce9"),
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;

View File

@@ -24,6 +24,9 @@ public enum OperateLogFieldValueEnum {
AFTER_INVESTMENT_MANAGER_USERNAME("afterInvestmentManagerUsername", "转让后的招商经理姓名"),
AFTER_INVESTMENT_MANAGER_MOBILE("afterInvestmentManagerMobile", "转让后的招商经理手机好"),
INTERVIEW_AGREEMENT_RAW_DATETIME("rawInterviewDateTime", "同意的面试预约原始申请时间"),
INTERVIEW_PLAN_ID("interviewPlanId", "面试计划id"),
BEFORE_INTERVIEW_TIME("beforeInterviewTime", "修改前的面试时间"),
AFTER_INTERVIEW_TIME("afterInterviewTime", "修改后的面试时间"),

View File

@@ -21,6 +21,8 @@ public enum OperateTypeEnum {
CLOSE_FOLLOW("close_follow", "结束跟进", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REJECT_PUBLIC_REASON, REJECT_REAL_REASON, CERTIFY_FILE)),
TRANSFER_INVESTMENT_MANAGER("transfer_investment_manager", "转让招商经理", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INVESTMENT_MANAGER_USERNAME, BEFORE_INVESTMENT_MANAGER_MOBILE, AFTER_INVESTMENT_MANAGER_USERNAME, AFTER_INVESTMENT_MANAGER_MOBILE)),
INTERVIEW_APPOINTMENT("interview_appointment", "预约面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
INTERVIEW_APPOINTMENT_AGREEMENT("interview_appointment_agreement", "同意面试预约申请", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, INTERVIEW_AGREEMENT_RAW_DATETIME, INTERVIEW_PLAN_ID)),
AUTO_OPEN_INTERVIEW("auto_open_interview", "自动打开面试房间", Arrays.asList(OPERATE_TIME)),
INTERVIEWER_BOOK_INTERVIEW("interviewer_book_interview", "招商经理主动预约面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
MODIFY_INTERVIEW_TIME("modify_interview_time", "修改面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INTERVIEW_TIME, AFTER_INTERVIEW_TIME)),
ENTRUST_OTHERS("entrust_others", "委托他人", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, BEFORE_INTERVIEWR_NAME, AFTER_INTERVIEWR_NAME, BEFORE_INTERVIEWR_MOBILE, AFTER_INTERVIEWR_MOBILE)),
@@ -31,6 +33,7 @@ public enum OperateTypeEnum {
REJECT_INTERVIEW("reject_interview", "合作资格面试-拒绝并结束跟进", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REJECT_PUBLIC_REASON,REJECT_REAL_REASON, CERTIFY_FILE)),
CREATE_QUALIFYVERIFY("create_qualifyverify", "合作资格面试-创建资格审核", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
EXHIBITION_CREATE_QUALIFYVERIFY("exhibition_create_qualifyverify", "会销资格面试-创建资格审核", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
QUALIFYVERIFY_PASS("qualifyverify_pass", "合作资格面试-审核通过", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
QUALIFYVERIFY_REJECT("qualifyverify_reject", "合作资格面试-审核拒绝", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),

View File

@@ -18,6 +18,7 @@ public enum SMSMsgEnum {
SMS_INVATE("短信邀约", "【沪上阿姨】感谢您对沪上阿姨品牌的关注与支持,您可通过链接登记加盟申请信息,我们的客户经理将在第一时间与您联系。{$var}", "d7772108bb7d9767494818bcd39d2ec1"),
EXHIBITION_INFO_UPDATE("展会信息变更","【沪上阿姨】亲爱的伙伴,您好!您近期报名的加盟推介会信息有更新。名称为{$var},日期为{$var},地址为{$var}。感谢您的关注,期待早日与您合作!{$var}","d7772108bb7d9767494818bcd39d2ec1")
;
private String title;

View File

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

View File

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

View File

@@ -1,12 +1,5 @@
package com.cool.store.enums;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2023/6/9 16:35
@@ -21,7 +14,7 @@ public enum WorkflowStatusEnum {
//预约面试阶段
RESERVATION_0("0","待预约"),
RESERVATION_1("1","预约时间待审核"),
RESERVATION_1("1","待审核"),
RESERVATION_7("7","拒绝"),
RESERVATION_8("8","超时"),//超时未预约或未参加

View File

@@ -79,8 +79,8 @@ public class CoolDateUtils {
}
public static final Date parseDate(String dateString ){
DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_SEC);
public static final Date parseDate(String dateString ,String format){
DateFormat dateFormat = new SimpleDateFormat(format);
Date date = null;
try {
date = dateFormat.parse(dateString);
@@ -91,4 +91,5 @@ public class CoolDateUtils {
}
}

View File

@@ -1,10 +1,13 @@
package com.cool.store.utils;
import com.tencentyun.TLSSigAPIv2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* 腾讯实时音视频TRTC工具类
*/
@Component
public class TRTCUtils {
/**
@@ -12,6 +15,12 @@ public class TRTCUtils {
*/
private static final Long expired = 30L;
@Value("${trtc.sdkAppId:null}")
private Long sdkAppId;
@Value("${trtc.secretKey:null}")
private String key;
/**
* 生成 userSig 用于进入会议
* 详见 https://cloud.tencent.com/document/product/647/17275#.E8.B0.83.E8.AF.95.E8.B7.91.E9.80.9A.E9.98.B6.E6.AE.B5.E5.A6.82.E4.BD.95.E8.AE.A1.E7.AE.97-UserSig.EF.BC.9F
@@ -26,4 +35,9 @@ public class TRTCUtils {
return tlsSigAPIv2.genUserSig(userId, expiredTime);
}
public String genUserSig(String userId) {
TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, key);
return tlsSigAPIv2.genUserSig(userId, expired);
}
}

View File

@@ -12,10 +12,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -52,6 +49,15 @@ public class EnterpriseUserDAO {
return feishuUserIdsByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getFeishuUserId));
}
public List<String> getFeishuUserIdListByUserIds(List<String> userIdList){
if(CollectionUtils.isEmpty(userIdList)){
return new ArrayList<>(0);
}
List<EnterpriseUserDO> feishuUserIdsByUserIds = enterpriseUserMapper.getFeishuUserIdsByUserIds(userIdList);
return feishuUserIdsByUserIds.stream().map(EnterpriseUserDO::getFeishuUserId).collect(Collectors.toList());
}
public void batchInsertOrUpdate(List<EnterpriseUserDO> insertOrUpdateList) {
if(CollectionUtils.isEmpty(insertOrUpdateList)){
return;

View File

@@ -0,0 +1,115 @@
package com.cool.store.dao;
import com.cool.store.dto.exhibition.ExhibitionDTO;
import com.cool.store.dto.exhibition.ExhibitionStatisticsDTO;
import com.cool.store.entity.HyExhibitionDO;
import com.cool.store.mapper.HyExhibitionMapper;
import com.cool.store.utils.StringUtil;
import io.swagger.models.auth.In;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:06
* @Version 1.0
*/
@Repository
public class HyExhibitionDAO {
@Resource
HyExhibitionMapper hyExhibitionMapper;
public int insertSelective(HyExhibitionDO record){
if (record.getId() == null){
return -1;
}
return hyExhibitionMapper.insertSelective(record);
}
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:38
*/
public HyExhibitionDO selectByPrimaryKey(Integer id){
if (id == null){
return null;
}
return hyExhibitionMapper.selectByPrimaryKey(id);
}
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:38
*/
public int updateByPrimaryKeySelective(HyExhibitionDO record){
if (record.getId() == null){
return -1;
}
return hyExhibitionMapper.updateByPrimaryKeySelective(record);
}
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:38
*/
public int deleteByPrimaryKey(Integer id){
if (id == null){
return -1;
}
return hyExhibitionMapper.deleteByPrimaryKey(id);
}
public int batchInsert(List<HyExhibitionDO> records){
if (CollectionUtils.isEmpty(records)){
return -1;
}
return hyExhibitionMapper.batchInsert(records);
}
public int batchUpdate(List<HyExhibitionDO> records){
if (CollectionUtils.isEmpty(records)){
return -1;
}
return hyExhibitionMapper.batchUpdate(records);
}
public List<HyExhibitionDO> getExhibitionListByUserId(String userId, String startDate, Integer closedType){
if (StringUtil.isEmpty(userId)){
return new ArrayList<>();
}
return hyExhibitionMapper.getExhibitionListByUserId(userId,startDate,closedType);
}
public Map<String,ExhibitionStatisticsDTO> exhibitionStatisticsMap(List<String> list) {
if (CollectionUtils.isEmpty(list)) {
return new HashMap<>(4);
}
List<ExhibitionStatisticsDTO> result = hyExhibitionMapper.exhibitionStatistic(list);
return result.stream().collect(Collectors.toMap(ExhibitionStatisticsDTO::getExhibitionCode, date -> date));
}
public List<ExhibitionDTO> listByExhibitionGroupIds(List<Integer> exhibitionGroupIdList){
if (CollectionUtils.isEmpty(exhibitionGroupIdList)){
return new ArrayList<>();
}
return hyExhibitionMapper.listByExhibitionGroupIds(exhibitionGroupIdList);
}
public Integer lineSignUpCount(Integer exhibitionGroupId, Long lineId){
return hyExhibitionMapper.lineSignUpCount(exhibitionGroupId,lineId);
}
}

View File

@@ -0,0 +1,75 @@
package com.cool.store.dao;
import com.cool.store.dto.exhibition.MyExhibitionGroupDTO;
import com.cool.store.entity.HyExhibitionGroupDO;
import com.cool.store.mapper.HyExhibitionGroupMapper;
import com.cool.store.utils.StringUtil;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:11
* @Version 1.0
*/
@Repository
public class HyExhibitionGroupDAO {
@Resource
HyExhibitionGroupMapper hyExhibitionGroupMapper;
public int insertSelective(HyExhibitionGroupDO record){
if (record == null){
return -1;
}
return hyExhibitionGroupMapper.insertSelective(record);
}
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:38
*/
public HyExhibitionGroupDO selectByPrimaryKey(Integer id){
if (id == null){
return null;
}
return hyExhibitionGroupMapper.selectByPrimaryKey(id);
}
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:38
*/
public int updateByPrimaryKeySelective(HyExhibitionGroupDO record){
if (record.getId() == null){
return -1;
}
return hyExhibitionGroupMapper.updateByPrimaryKeySelective(record);
}
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:38
*/
public int deleteByPrimaryKey(Integer id){
if (id == null){
return -1;
}
return hyExhibitionGroupMapper.deleteByPrimaryKey(id);
}
public List<MyExhibitionGroupDTO> listByCreator(String userId){
if (StringUtil.isEmpty(userId)){
return new ArrayList<>();
}
return hyExhibitionGroupMapper.listByCreator(userId);
}
}

View File

@@ -0,0 +1,141 @@
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;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:13
* @Version 1.0
*/
@Repository
public class HyPartnerExhibitionDAO {
@Resource
HyPartnerExhibitionMapper hyPartnerExhibitionMapper;
public int insertSelective(HyPartnerExhibitionDO record){
if (record == null){
return -1;
}
return hyPartnerExhibitionMapper.insertSelective(record);
}
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:38
*/
public HyPartnerExhibitionDO selectByPrimaryKey(Long id){
if (id == null){
return new HyPartnerExhibitionDO();
}
return hyPartnerExhibitionMapper.selectByPrimaryKey(id);
}
public HyPartnerExhibitionDO querySelective(HyPartnerExhibitionDO record){
if (record == null){
return new HyPartnerExhibitionDO();
}
return hyPartnerExhibitionMapper.querySelective(record);
}
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:38
*/
public int updateByPrimaryKeySelective(HyPartnerExhibitionDO record){
if (record.getId() == null){
return -1;
}
return hyPartnerExhibitionMapper.updateByPrimaryKeySelective(record);
}
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:38
*/
public int deleteByPrimaryKey(Long id){
if (id == null){
return -1;
}
return hyPartnerExhibitionMapper.deleteByPrimaryKey(id);
}
public List<ExhibitionLineDTO> getExhibitionLine(Integer exhibitionId){
if (exhibitionId == null){
return new ArrayList<>();
}
return hyPartnerExhibitionMapper.getExhibitionLine(exhibitionId);
}
public List<ExhibitionLineDTO> exhibitionLineList(Integer exhibitionId,Integer participationStatus, String partnerUserId,String userId){
if (exhibitionId == null){
return new ArrayList<>();
}
return hyPartnerExhibitionMapper.exhibitionLineList(exhibitionId,participationStatus, partnerUserId,userId);
}
public void rejectExhibitionInterview(String partnerLineId) {
if (StringUtils.isEmpty(partnerLineId)){
return;
}
hyPartnerExhibitionMapper.rejectExhibitionInterview(partnerLineId);
}
public void deleteAllByLineId(Long partnerLineId) {
if (partnerLineId == null){
return;
}
hyPartnerExhibitionMapper.deleteAllByLineId(partnerLineId);
}
public List<Long> queryListByInterviewPlanIds(List<Long> interviewPlanIds) {
if (ObjectUtils.isEmpty(interviewPlanIds)) {
return new ArrayList<>();
}
return hyPartnerExhibitionMapper.queryListByInterviewPlanIds(interviewPlanIds);
}
public List<Long> queryListByLineIds(List<Long> lindIds) {
if (ObjectUtils.isEmpty(lindIds)) {
return new ArrayList<>();
}
return hyPartnerExhibitionMapper.queryListByLineIds(lindIds);
}
public HyPartnerExhibitionInterviewDO queryPartnerExhibitionInterviewInfo(Long interviewPlanId, Long partnerLineId) {
if (interviewPlanId == null || partnerLineId == null) {
return new HyPartnerExhibitionInterviewDO();
}
return hyPartnerExhibitionMapper.queryPartnerExhibitionInterviewInfo(interviewPlanId, partnerLineId);
}
public List<ExhibitionLineBaseDTO> exhibitionLineBaseInfo(String partnerName, Integer exhibitionId) {
if (exhibitionId == null) {
return new ArrayList<>();
}
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);
}
}

View File

@@ -227,4 +227,19 @@ public class HyPartnerLineInfoDAO {
,partnerName,partnerMobile,investmentManagerId,userPortraitQueryType,intentAreaQueryType,lineStartTime,lineEndTime,userChannelQueryType,sortField,sortOrder,limit1,limit2);
}
public List<LineInterviewDTO> lineInterviewList(List<Integer> lineIds){
if (CollectionUtils.isEmpty(lineIds)){
return new ArrayList<>();
}
return hyPartnerLineInfoMapper.lineInterviewList(lineIds);
}
public List<LineInterviewDTO> lineInvestmentList(List<Integer> lineIds){
if (CollectionUtils.isEmpty(lineIds)){
return new ArrayList<>();
}
return hyPartnerLineInfoMapper.lineInvestmentList(lineIds);
}
}

View File

@@ -0,0 +1,45 @@
package com.cool.store.mapper;
import com.cool.store.dto.exhibition.MyExhibitionGroupDTO;
import com.cool.store.entity.HyExhibitionGroupDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-11-30 11:55
*/
public interface HyExhibitionGroupMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-11-30 01:36
*/
int insertSelective( HyExhibitionGroupDO record);
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:36
*/
HyExhibitionGroupDO selectByPrimaryKey(Integer id);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:36
*/
int updateByPrimaryKeySelective(HyExhibitionGroupDO record);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:36
*/
int deleteByPrimaryKey(Integer id);
List<MyExhibitionGroupDTO> listByCreator(String userId);
}

View File

@@ -0,0 +1,61 @@
package com.cool.store.mapper;
import com.cool.store.dto.exhibition.ExhibitionDTO;
import com.cool.store.dto.exhibition.ExhibitionStatisticsDTO;
import com.cool.store.entity.HyExhibitionDO;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-11-30 11:47
*/
public interface HyExhibitionMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-11-30 01:38
*/
int insertSelective(HyExhibitionDO record);
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:38
*/
HyExhibitionDO selectByPrimaryKey(Integer id);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:38
*/
int updateByPrimaryKeySelective(HyExhibitionDO record);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:38
*/
int deleteByPrimaryKey(Integer id);
int batchInsert(@Param("records") List<HyExhibitionDO> records);
int batchUpdate(@Param("records") List<HyExhibitionDO> records);
List<HyExhibitionDO> getExhibitionListByUserId(@Param("userId") String userId,
@Param("startDate") String startDate,
@Param("closedType") Integer closedType);
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);
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.entity.SyncEcCustomerLabelDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -10,6 +11,7 @@ import java.util.List;
* @author zhangchenbiao
* @date 2023-05-29 03:51
*/
@Mapper
public interface HyPartnerBaseInfoMapper {
/**
*

View File

@@ -1,12 +1,14 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerCertificationInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author zhangchenbiao
* @date 2023-05-29 03:51
*/
@Mapper
public interface HyPartnerCertificationInfoMapper {
/**
*

View File

@@ -0,0 +1,106 @@
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;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-11-30 11:55
*/
@Mapper
public interface HyPartnerExhibitionMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-11-30 01:39
*/
int insertSelective(HyPartnerExhibitionDO record);
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:39
*/
HyPartnerExhibitionDO selectByPrimaryKey(Long id);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:39
*/
int updateByPrimaryKeySelective(HyPartnerExhibitionDO record);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:39
*/
int deleteByPrimaryKey(Long id);
/**
* 展会参与线索信息
* @param exhibitionId
* @return
*/
List<ExhibitionLineDTO> getExhibitionLine(Integer exhibitionId);
HyPartnerExhibitionDO querySelective(HyPartnerExhibitionDO record);
List<ExhibitionLineDTO> exhibitionLineList(Integer exhibitionId,Integer participationStatus, String partnerUserId,String userId );
/**
* 将线索参加的会销面试状态设为不通过
* @param partnerLineId
*/
void rejectExhibitionInterview(@Param("partnerLineId") String partnerLineId);
/**
* 删除线索所有的会销信息
* @param partnerLineId
*/
void deleteAllByLineId(Long partnerLineId);
/**
* 查询在会销中进行的面试的面试计划id
* @param interviewPlanIds
* @return
*/
List<Long> queryListByInterviewPlanIds(@Param("interviewPlanIds") List<Long> interviewPlanIds);
/**
* 查询处在会销面试状态中的线索ids
* @param lindIds
* @return
*/
List<Long> queryListByLineIds(@Param("lineIds") List<Long> lindIds);
/**
* 查询线索参加的会销面试相关信息
* @param interviewPlanId
* @param partnerLineId
* @return
*/
HyPartnerExhibitionInterviewDO queryPartnerExhibitionInterviewInfo(@Param("interviewPlanId") Long interviewPlanId, @Param("partnerLineId") Long partnerLineId);
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 );
}

View File

@@ -5,6 +5,7 @@ import com.cool.store.request.GetInterviewListReq;
import com.cool.store.vo.EnterInterviewVO;
import com.cool.store.vo.PartnerInterviewInfoVO;
import com.cool.store.vo.PartnerPassLetterDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -13,6 +14,7 @@ import java.util.List;
* @author zhangchenbiao
* @date 2023-06-09 05:51
*/
@Mapper
public interface HyPartnerInterviewMapper {
/**
*

View File

@@ -1,6 +1,5 @@
package com.cool.store.mapper;
import com.cool.store.dto.calendar.UserFreeBusyInfoDTO;
import com.cool.store.dto.message.RemindInterviewMsgDTO;
import com.cool.store.dto.partner.AdvanceLineDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
@@ -11,6 +10,7 @@ import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.request.GetInterviewListReq;
import com.cool.store.vo.EnterpriseUserBaseInfoVO;
import com.cool.store.vo.interview.InterviewVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@@ -20,6 +20,7 @@ import java.util.List;
* @author zhangchenbiao
* @date 2023-05-29 03:52
*/
@Mapper
public interface HyPartnerInterviewPlanMapper {
/**
*

View File

@@ -6,6 +6,7 @@ import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
import com.cool.store.dto.partner.StageCountDTO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.vo.LinePageInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@@ -15,6 +16,7 @@ import java.util.List;
* @author zhangchenbiao
* @date 2023-05-29 03:52
*/
@Mapper
public interface HyPartnerLineInfoMapper {
/**
*
@@ -315,4 +317,18 @@ public interface HyPartnerLineInfoMapper {
@Param("limit2") Integer limit2
);
/**
* 查询线索面试管信息
* @param list
* @return
*/
List<LineInterviewDTO> lineInterviewList(@Param("list") List<Integer> list);
/**
* 查询线索招商经理信息
* @param list
* @return
*/
List<LineInterviewDTO> lineInvestmentList(@Param("list") List<Integer> list);
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerTaskInfoLogDO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -10,6 +11,7 @@ import java.util.List;
* @author zhangchenbiao
* @date 2023-05-29 03:53
*/
@Mapper
public interface HyPartnerTaskInfoLogMapper {
/**
*

View File

@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyExhibitionGroupMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyExhibitionGroupDO">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="exhibition_group_name" jdbcType="VARCHAR" property="exhibitionGroupName" />
<result column="closed" jdbcType="BIT" property="closed" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<sql id="Base_Column_List">
id, exhibition_group_name, closed, create_time, update_time, creator, updater, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_exhibition_group
where id = #{id,jdbcType=INTEGER}
and deleted = 0
</select>
<select id="listByCreator" resultType="com.cool.store.dto.exhibition.MyExhibitionGroupDTO">
select
eg.id as id ,
eg.exhibition_group_name as exhibitionGroupName,
eg.closed as closed,
eg.creator as createId,
eu.name as createName,
eu.mobile as mobile
from hy_exhibition_group eg
left join enterprise_user eu on eg.creator = eu.user_id
where eg.deleted = 0
<if test="userId!=null and userId!=''">
and eg.creator = #{userId,jdbcType=VARCHAR}
</if>
order by eg.create_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from hy_exhibition_group
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyExhibitionGroupDO" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into hy_exhibition_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupName != null">
exhibition_group_name,
</if>
<if test="closed != null">
closed,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="updater != null">
updater,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupName != null">
#{exhibitionGroupName,jdbcType=VARCHAR},
</if>
<if test="closed != null">
#{closed,jdbcType=BIT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
#{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyExhibitionGroupDO">
update hy_exhibition_group
<set>
<if test="exhibitionGroupName != null">
exhibition_group_name = #{exhibitionGroupName,jdbcType=VARCHAR},
</if>
<if test="closed != null">
closed = #{closed,jdbcType=BIT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
updater = #{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=INTEGER}
</if>
<if test="null != exhibitionGroupName">
and t.exhibition_group_name = #{exhibitionGroupName,jdbcType=VARCHAR}
</if>
<if test="null != closed">
and t.closed = #{closed,jdbcType=BIT}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
<if test="null != creator">
and t.creator = #{creator,jdbcType=VARCHAR}
</if>
<if test="null != updater">
and t.updater = #{updater,jdbcType=VARCHAR}
</if>
<if test="null != deleted">
and t.deleted = #{deleted,jdbcType=BIT}
</if>
</trim>
</sql>
</mapper>

View File

@@ -0,0 +1,362 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyExhibitionMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyExhibitionDO">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="exhibition_group_id" jdbcType="INTEGER" property="exhibitionGroupId" />
<result column="exhibition_code" jdbcType="VARCHAR" property="exhibitionCode" />
<result column="exhibition_name" jdbcType="VARCHAR" property="exhibitionName" />
<result column="start_date" jdbcType="DATE" property="startDate" />
<result column="location" jdbcType="VARCHAR" property="location" />
<result column="closed_type" jdbcType="TINYINT" property="closedType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="close_time" jdbcType="TIMESTAMP" property="closeTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.HyExhibitionDO">
<result column="collaborators" jdbcType="LONGVARCHAR" property="collaborators" />
</resultMap>
<sql id="Base_Column_List">
id, exhibition_group_id, exhibition_code, exhibition_name, start_date, location,
closed_type, create_time, update_time, creator, updater, deleted, close_time
</sql>
<sql id="Blob_Column_List">
collaborators
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from hy_exhibition
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from hy_exhibition
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyExhibitionDO">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into hy_exhibition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupId != null">
exhibition_group_id,
</if>
<if test="exhibitionCode != null">
exhibition_code,
</if>
<if test="exhibitionName != null">
exhibition_name,
</if>
<if test="startDate != null">
start_date,
</if>
<if test="location != null">
location,
</if>
<if test="closedType != null">
closed_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="updater != null">
updater,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="closeTime != null">
close_time,
</if>
<if test="collaborators != null">
collaborators,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupId != null">
#{exhibitionGroupId,jdbcType=INTEGER},
</if>
<if test="exhibitionCode != null">
#{exhibitionCode,jdbcType=VARCHAR},
</if>
<if test="exhibitionName != null">
#{exhibitionName,jdbcType=VARCHAR},
</if>
<if test="startDate != null">
#{startDate,jdbcType=DATE},
</if>
<if test="location != null">
#{location,jdbcType=VARCHAR},
</if>
<if test="closedType != null">
#{closedType,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
#{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
<if test="closeTime != null">
#{closeTime,jdbcType=TIMESTAMP},
</if>
<if test="collaborators != null">
#{collaborators,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<insert id="batchInsert" keyColumn="id" keyProperty="records.id" useGeneratedKeys="true">
insert into hy_exhibition
(
exhibition_group_id,
exhibition_code,
exhibition_name,
start_date,
location,
collaborators,
creator
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.exhibitionGroupId},
#{record.exhibitionCode},
#{record.exhibitionName},
#{record.startDate},
#{record.location},
#{record.collaborators},
#{record.creator}
)
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyExhibitionDO">
update hy_exhibition
<set>
<if test="exhibitionGroupId != null">
exhibition_group_id = #{exhibitionGroupId,jdbcType=INTEGER},
</if>
<if test="exhibitionCode != null">
exhibition_code = #{exhibitionCode,jdbcType=VARCHAR},
</if>
<if test="exhibitionName != null">
exhibition_name = #{exhibitionName,jdbcType=VARCHAR},
</if>
<if test="startDate != null">
start_date = #{startDate,jdbcType=DATE},
</if>
<if test="location != null">
location = #{location,jdbcType=VARCHAR},
</if>
<if test="closedType != null">
closed_type = #{closedType,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
updater = #{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
<if test="closeTime != null">
close_time = #{closeTime,jdbcType=TIMESTAMP},
</if>
<if test="collaborators != null">
collaborators = #{collaborators,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="batchUpdate">
update hy_exhibition
set
exhibition_name = CASE id
<foreach collection="records" item="record">
WHEN #{record.id} THEN #{record.exhibitionName}
</foreach>
END,
location = CASE id
<foreach collection="records" item="record">
WHEN #{record.id} THEN #{record.location}
</foreach>
END,
updater = CASE id
<foreach collection="records" item="record">
WHEN #{record.id} THEN #{record.updater}
</foreach>
END,
collaborators = CASE id
<foreach collection="records" item="record">
WHEN #{record.id} THEN #{record.collaborators}
</foreach>
END
where id in
<foreach collection="records" item="record" open="(" separator="," close=")">
#{record.id}
</foreach>
</update>
<select id="getExhibitionListByUserId" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from hy_exhibition
<where>
<if test="startDate != null and startDate!='' ">
and start_date = #{startDate}
</if>
<if test="closedType != null and closedType==0 ">
and closed_type = #{closedType}
</if>
<if test="closedType != null and closedType==1 ">
and closed_type in (1,2)
</if>
<if test="userId != null and userId!='' ">
and (creator = #{userId} or collaborators like CONCAT('%,', #{userId} ,',%'))
</if>
</where>
<if test="closedType != null and closedType==0 ">
ORDER BY start_date,id desc
</if>
<if test="closedType != null and closedType==1 ">
ORDER BY start_date desc ,id desc
</if>
<if test="startDate != null and startDate!='' ">
ORDER BY closed_type asc,id desc
</if>
</select>
<select id="listByExhibitionGroupIds" resultType="com.cool.store.dto.exhibition.ExhibitionDTO">
select
id as id ,
exhibition_group_id as exhibitionGroupId,
start_date as startDate,
close_time as closeTime,
location as location,
exhibition_name as exhibitionName,
collaborators as collaboratorStr
from hy_exhibition
<where>
<foreach collection="list" item="groupId" open="and exhibition_group_id in (" separator="," close=")">
#{groupId}
</foreach>
</where>
order by id asc
</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,
COALESCE(count(1),0) as signUpCount,
COALESCE(sum( CASE WHEN participation_status = 1 THEN 1 ELSE 0 END ),0) as checkInCount,
COALESCE(sum( CASE WHEN participation_status = 2 THEN 1 ELSE 0 END ),0) as formFillCount,
COALESCE(sum( CASE WHEN participation_status in (3,4,5,6) THEN 1 ELSE 0 END ),0) as interviewCount
from hy_partner_exhibition
<where>
<foreach collection="list" item="code" open="and exhibition_code in (" separator="," close=")">
#{code}
</foreach>
</where>
group by exhibition_code
</select>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=INTEGER}
</if>
<if test="null != exhibitionGroupId">
and t.exhibition_group_id = #{exhibitionGroupId,jdbcType=INTEGER}
</if>
<if test="null != exhibitionCode">
and t.exhibition_code = #{exhibitionCode,jdbcType=VARCHAR}
</if>
<if test="null != exhibitionName">
and t.exhibition_name = #{exhibitionName,jdbcType=VARCHAR}
</if>
<if test="null != startDate">
and t.start_date = #{startDate,jdbcType=DATE}
</if>
<if test="null != location">
and t.location = #{location,jdbcType=VARCHAR}
</if>
<if test="null != closedType">
and t.closed_type = #{closedType,jdbcType=TINYINT}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
<if test="null != creator">
and t.creator = #{creator,jdbcType=VARCHAR}
</if>
<if test="null != updater">
and t.updater = #{updater,jdbcType=VARCHAR}
</if>
<if test="null != deleted">
and t.deleted = #{deleted,jdbcType=BIT}
</if>
<if test="null != closeTime">
and t.close_time = #{closeTime,jdbcType=TIMESTAMP}
</if>
<if test="null != collaborators">
and t.collaborators = #{collaborators,jdbcType=LONGVARCHAR}
</if>
</trim>
</sql>
</mapper>

View File

@@ -0,0 +1,457 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyPartnerExhibitionMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerExhibitionDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="exhibition_id" jdbcType="BIGINT" property="exhibitionId" />
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="want_shop_area" jdbcType="VARCHAR" property="wantShopArea" />
<result column="investment_manager_name" jdbcType="VARCHAR" property="investmentManagerName" />
<result column="expected_visitors_count" jdbcType="INTEGER" property="expectedVisitorsCount" />
<result column="expected_information" jdbcType="VARCHAR" property="expectedInformation" />
<result column="participation_status" jdbcType="TINYINT" property="participationStatus" />
<result column="interview_plan_id" jdbcType="BIGINT" property="interviewPlanId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="check_in_time" jdbcType="TIMESTAMP" property="checkInTime" />
</resultMap>
<sql id="Base_Column_List">
id, exhibition_id, partner_line_id, partner_id, want_shop_area, investment_manager_name,
expected_visitors_count, expected_information, participation_status, interview_plan_id,
create_time, update_time, creator, updater, deleted,check_in_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_exhibition
where id = #{id,jdbcType=BIGINT}
</select>
<select id="querySelective" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_exhibition
<where>
<if test="exhibitionId != null">
and exhibition_id = #{exhibitionId,jdbcType=BIGINT}
</if>
<if test="partnerLineId != null">
and partner_line_id = #{partnerLineId,jdbcType=BIGINT}
</if>
<if test="partnerId != null">
and partner_id = #{partnerId,jdbcType=VARCHAR}
</if>
<if test="wantShopArea != null">
and want_shop_area = #{wantShopArea,jdbcType=VARCHAR}
</if>
<if test="investmentManagerName != null">
and investment_manager_name = #{investmentManagerName,jdbcType=VARCHAR}
</if>
<if test="expectedVisitorsCount != null">
and expected_visitors_count = #{expectedVisitorsCount,jdbcType=INTEGER}
</if>
<if test="expectedInformation != null">
and expected_information = #{expectedInformation,jdbcType=VARCHAR}
</if>
<if test="participationStatus != null">
and participation_status = #{participationStatus,jdbcType=TINYINT}
</if>
<if test="interviewPlanId != null">
and interview_plan_id = #{interviewPlanId,jdbcType=BIGINT}
</if>
<if test="createTime != null">
and create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="updateTime != null">
and update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
<if test="creator != null">
and creator = #{creator,jdbcType=VARCHAR}
</if>
<if test="updater != null">
and updater = #{updater,jdbcType=VARCHAR}
</if>
<if test="deleted != null">
and deleted = #{deleted,jdbcType=BIT}
</if>
</where>
</select>
<select id="exhibitionLineList" resultType="com.cool.store.dto.exhibition.ExhibitionLineDTO">
select
hpe.id as id ,
hpe.partner_id as partnerId,
hpe.partner_line_id as lineId,
hpe.participation_status as participationStatus,
hpe.investment_manager_name as customerManager,
hpe.expected_visitors_count as expectedVisitorsCount,
hpe.expected_information as expectedInformation,
hpui.username as partnerName,
hpui.mobile as mobile,
hoai.id as wantShopArea,
hoai.area_path as wantShopAreaName
from hy_partner_exhibition hpe
left join hy_partner_user_info hpui on hpe.partner_id = hpui.partner_id
left join hy_open_area_info hoai on hpe.want_shop_area = hoai.id
left join hy_partner_intent_info hpii on hpii.partner_line_id = hpe.partner_line_id
left join hy_partner_interview_plan hpip on hpip.id = hpe.interview_plan_id
<where>
<if test="exhibitionId != null">
and hpe.exhibition_id = #{exhibitionId,jdbcType=BIGINT}
</if>
<if test="participationStatus != null">
<if test="participationStatus==4">
and hpe.participation_status in (4,5,6)
</if>
<if test="participationStatus!=4">
and hpe.participation_status = #{participationStatus,jdbcType=BIGINT}
</if>
</if>
<if test="partnerUserId != null and partnerUserId!=''">
and hpui.user_id = #{partnerUserId,jdbcType=VARCHAR}
</if>
</where>
<if test="participationStatus == null">
ORDER BY CASE WHEN hpe.participation_status != 7 THEN 1 ELSE 2 END, hpe.create_time DESC
</if>
<if test="participationStatus != null and participationStatus==1">
ORDER BY hpe.check_in_time DESC
</if>
<if test="participationStatus != null and participationStatus==2">
ORDER BY hpii.create_time DESC
</if>
<if test="participationStatus != null and participationStatus==3">
ORDER BY CASE
WHEN hpip.interviewer = #{userId} THEN 0 ELSE 1 END,
hpip.actual_start_time DESC
</if>
<if test="participationStatus != null and participationStatus==4">
ORDER BY hpe.participation_status asc,
CASE WHEN hpip.interviewer = #{userId} THEN 0 ELSE 1 END,
hpip.actual_end_time DESC
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_partner_exhibition
where id = #{id,jdbcType=BIGINT}
</delete>
<select id="getExhibitionLine" resultType="com.cool.store.dto.exhibition.ExhibitionLineDTO">
select
hpe.partner_id as partnerId,
hpe.exhibition_id as exhibitionId,
pu.username as partnerName,
pu.mobile as mobile
from hy_partner_exhibition hpe left join hy_partner_user_info pu on hpe.partner_id = pu.partner_id
where hpe.participation_status != 7
<if test="exhibitionId != null and exhibitionId!=''">
and hpe.exhibition_id = #{exhibitionId}
</if>
</select>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyPartnerExhibitionDO">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into hy_partner_exhibition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exhibitionId != null">
exhibition_id,
</if>
<if test="partnerLineId != null">
partner_line_id,
</if>
<if test="partnerId != null">
partner_id,
</if>
<if test="wantShopArea != null">
want_shop_area,
</if>
<if test="investmentManagerName != null">
investment_manager_name,
</if>
<if test="expectedVisitorsCount != null">
expected_visitors_count,
</if>
<if test="expectedInformation != null">
expected_information,
</if>
<if test="participationStatus != null">
participation_status,
</if>
<if test="interviewPlanId != null">
interview_plan_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="updater != null">
updater,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="exhibitionId != null">
#{exhibitionId,jdbcType=VARCHAR},
</if>
<if test="partnerLineId != null">
#{partnerLineId,jdbcType=BIGINT},
</if>
<if test="partnerId != null">
#{partnerId,jdbcType=VARCHAR},
</if>
<if test="wantShopArea != null">
#{wantShopArea,jdbcType=VARCHAR},
</if>
<if test="investmentManagerName != null">
#{investmentManagerName,jdbcType=VARCHAR},
</if>
<if test="expectedVisitorsCount != null">
#{expectedVisitorsCount,jdbcType=INTEGER},
</if>
<if test="expectedInformation != null">
#{expectedInformation,jdbcType=VARCHAR},
</if>
<if test="participationStatus != null">
#{participationStatus,jdbcType=TINYINT},
</if>
<if test="interviewPlanId != null">
#{interviewPlanId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
#{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerExhibitionDO">
update hy_partner_exhibition
<set>
<if test="exhibitionId != null">
exhibition_id = #{exhibitionId,jdbcType=BIGINT},
</if>
<if test="partnerLineId != null">
partner_line_id = #{partnerLineId,jdbcType=BIGINT},
</if>
<if test="partnerId != null">
partner_id = #{partnerId,jdbcType=VARCHAR},
</if>
<if test="wantShopArea != null">
want_shop_area = #{wantShopArea,jdbcType=VARCHAR},
</if>
<if test="investmentManagerName != null">
investment_manager_name = #{investmentManagerName,jdbcType=VARCHAR},
</if>
<if test="expectedVisitorsCount != null">
expected_visitors_count = #{expectedVisitorsCount,jdbcType=INTEGER},
</if>
<if test="expectedInformation != null">
expected_information = #{expectedInformation,jdbcType=VARCHAR},
</if>
<if test="participationStatus != null">
participation_status = #{participationStatus,jdbcType=TINYINT},
</if>
<if test="interviewPlanId != null">
interview_plan_id = #{interviewPlanId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
updater = #{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=BIGINT}
</if>
<if test="null != exhibitionId">
and t.exhibition_id = #{exhibitionId,jdbcType=VARCHAR}
</if>
<if test="null != partnerLineId">
and t.partner_line_id = #{partnerLineId,jdbcType=BIGINT}
</if>
<if test="null != partnerId">
and t.partner_id = #{partnerId,jdbcType=VARCHAR}
</if>
<if test="null != wantShopArea">
and t.want_shop_area = #{wantShopArea,jdbcType=VARCHAR}
</if>
<if test="null != investmentManagerName">
and t.investment_manager_name = #{investmentManagerName,jdbcType=VARCHAR}
</if>
<if test="null != expectedVisitorsCount">
and t.expected_visitors_count = #{expectedVisitorsCount,jdbcType=INTEGER}
</if>
<if test="null != expectedInformation">
and t.expected_information = #{expectedInformation,jdbcType=VARCHAR}
</if>
<if test="null != participationStatus">
and t.participation_status = #{participationStatus,jdbcType=TINYINT}
</if>
<if test="null != interviewPlanId">
and t.interview_plan_id = #{interviewPlanId,jdbcType=BIGINT}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
<if test="null != creator">
and t.creator = #{creator,jdbcType=VARCHAR}
</if>
<if test="null != updater">
and t.updater = #{updater,jdbcType=VARCHAR}
</if>
<if test="null != deleted">
and t.deleted = #{deleted,jdbcType=BIT}
</if>
</trim>
</sql>
<update id="rejectExhibitionInterview">
UPDATE hy_partner_exhibition
SET participation_status = 6
WHERE partner_line_id = #{partnerLineId}
AND participation_status = 4
</update>
<update id="deleteAllByLineId">
UPDATE hy_partner_exhibition
SET deleted = 1
WHERE partner_line_id = #{partnerLineId}
AND deleted = 0
</update>
<select id="queryListByInterviewPlanIds" resultType="java.lang.Long">
SELECT interview_plan_id
FROM hy_partner_exhibition
WHERE deleted = 0
AND interview_plan_id IN (
<foreach collection="interviewPlanIds" item="interviewPlanId" separator=",">
#{interviewPlanId}
</foreach>
)
</select>
<select id="queryListByLineIds" resultType="java.lang.Long">
SELECT partner_line_id
FROM (
SELECT partner_line_id, exhibition_id
FROM hy_partner_exhibition
WHERE partner_line_id IN (
<foreach collection="lineIds" item="lineId" separator=",">
#{lineId}
</foreach>
)
AND deleted = 0
AND participation_status = 4
) t1
LEFT JOIN (
SELECT id, closed_type
FROM hy_exhibition
WHERE deleted = 0
AND closed_type = 0
) t2 ON t1.exhibition_id = t2.id
WHERE closed_type = 0
</select>
<select id="queryPartnerExhibitionInterviewInfo"
resultType="com.cool.store.entity.HyPartnerExhibitionInterviewDO">
SELECT
exhibition_id AS exhibitionId,
interview_plan_id AS interviewPlanId,
exhibition_name AS exhibitionName,
start_date AS exhibitionDate
FROM (
SELECT exhibition_id, interview_plan_id
FROM hy_partner_exhibition
WHERE deleted = 0
AND partner_line_id = #{partnerLineId}
AND interview_plan_id = #{interviewPlanId}
) t1 LEFT JOIN (
SELECT id, exhibition_name, start_date
FROM hy_exhibition
WHERE deleted = 0
) t2 ON t1.exhibition_id = t2.id
</select>
<select id="exhibitionLineBaseInfo" resultType="com.cool.store.dto.exhibition.ExhibitionLineBaseDTO">
select
hpe.participation_status as participationStatus,
hpui.username as partnerName,
hpui.partner_id as partnerId,
hpui.mobile as mobile
from hy_partner_exhibition hpe
left join hy_partner_user_info hpui
on hpe.partner_id = hpui.partner_id
<where>
<if test="partnerName!=null and partnerName!=''">
hpui.username like concat("%", #{partnerName}, "%")
</if>
<if test="id!=null">
hpe.exhibition_id = #{id}
</if>
</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>

View File

@@ -272,12 +272,14 @@
<select id="getInterviewCount" resultType="com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO">
select
ifnull(sum(if(interview_date = #{currentDate} and room_status!=2,1,0)),0) as currentDayInterviewCount,
ifnull(sum(if(start_time>#{startTime} and end_time <![CDATA[<]]> #{endTime},1,0)),0) as lastSevenDayInterviewCount
FROM hy_partner_interview_plan
ifnull(sum(if(interview_date = '2023-11-27' and room_status!=2,1,0)),0) as currentDayInterviewCount,
ifnull(sum(if(start_time &gt; '2023-11-01 00:00:00' and end_time &lt; '2023-11-30 23:59:59',1,0)),0) as lastSevenDayInterviewCount
FROM hy_partner_interview_plan t1
LEFT JOIN hy_partner_exhibition t2 ON t1.id = t2.interview_plan_id
where interviewer = #{userId}
and deleted = 0
and application_approved = 1
and t1.deleted = 0
and t1.application_approved = 1
and t2.interview_plan_id IS NULL
</select>
<select id="getInterviewPlanList" resultMap="BaseResultMap">

View File

@@ -27,7 +27,7 @@
<result column="allot_time" jdbcType="TIMESTAMP" property="allotTime" />
</resultMap>
<sql id="Base_Column_List">
id, partner_id, workflow_stage, workflow_status, line_status, investment_manager,
id, partner_id, workflow_stage, workflow_status, line_status, whether_in_exhibition, investment_manager,
development_director, development_manager, deadline, pass_reason, reject_public_reason,
reject_real_reason, certify_file, deleted, create_time, update_time, close_time,
close_user_id,create_user_id,create_user_mobile,operator_type,update_user_id,allot_time
@@ -92,6 +92,9 @@
<if test="record.lineStatus != null">
line_status,
</if>
<if test="record.whetherInExhibition != null">
whether_in_exhibition,
</if>
<if test="record.investmentManager != null">
investment_manager,
</if>
@@ -160,6 +163,9 @@
<if test="record.lineStatus != null">
#{record.lineStatus},
</if>
<if test="record.whetherInExhibition != null">
#{record.whetherInExhibition},
</if>
<if test="record.investmentManager != null">
#{record.investmentManager},
</if>
@@ -231,6 +237,9 @@
<if test="record.lineStatus != null">
line_status = #{record.lineStatus},
</if>
<if test="record.whetherInExhibition != null">
whether_in_exhibition = #{record.whetherInExhibition},
</if>
<if test="record.investmentManager != null">
investment_manager = #{record.investmentManager},
</if>
@@ -290,6 +299,7 @@
workflow_stage = #{record.workflowStage},
workflow_status = #{record.workflowStatus},
line_status = #{record.lineStatus},
whether_in_exhibition = #{record.whetherInExhibition},
investment_manager = #{record.investmentManager},
development_director = #{record.developmentDirector},
development_manager = #{record.developmentManager},
@@ -351,6 +361,7 @@
a.partner_id as partnerId,
a.workflow_stage as workflowStage,
a.line_status as lineStatus,
a.whether_in_exhibition as whetherInExhibition,
a.workflow_status as workflowStatus,
a.partner_id as partnerUserId,
a.investment_manager as investmentManager,
@@ -534,6 +545,7 @@
hpli.investment_manager as investmentManager,
hpli.development_manager as developmentManager,
hpli.line_status as lineStatus,
hpli.whether_in_exhibition as whetherInExhibition,
hpli.update_time as updateTime,
hpuinfo.user_channel_id as userChannelId,
hpuinfo.want_shop_area as wantShopArea,
@@ -1012,4 +1024,40 @@
order by a.create_time desc limit #{limit1},#{limit2}
</select>
<select id="lineInterviewList" resultType="com.cool.store.dto.partner.LineInterviewDTO">
select
a.partner_line_id as lineId,
a.interviewer as interviewer,
b.mobile as interviewerMobile,
b.name as interviewerName
from hy_partner_interview_plan a
left join enterprise_user b on a.interviewer = b.user_id
<where>
and a.deleted = 0
<if test="list!=null and list.size>0">
<foreach collection="list" item="lineId" open="and a.partner_line_id in (" close=")" separator=",">
#{lineId}
</foreach>
</if>
</where>
</select>
<select id="lineInvestmentList" resultType="com.cool.store.dto.partner.LineInterviewDTO">
select
a.id as lineId,
a.investment_manager as investmentManager,
b.mobile as investmentManagerMobile,
b.name as investmentManagerName
from hy_partner_line_info a
left join enterprise_user b on a.investment_manager = b.user_id
<where>
<if test="list!=null and list.size>0">
<foreach collection="list" item="lineId" open="and a.id in (" close=")" separator=",">
#{lineId}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@@ -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">

View File

@@ -0,0 +1,17 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:30
* @Version 1.0
*/
@Data
public class CollaboratorDTO {
private String collaborateId;
private String collaborateName;
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:33
* @Version 1.0
*/
@Data
public class ExhibitionDTO {
private String exhibitionName;
private String location;
private String startDate;
private Integer id;
private Date closeTime;
private Integer exhibitionGroupId;
private String collaboratorStr;
private List<CollaboratorDTO> collaborators;
}

View File

@@ -0,0 +1,19 @@
package com.cool.store.dto.exhibition;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/11/30 15:03
* @version 1.0
*/
@Data
public class ExhibitionEnterInterviewDTO {
@ApiModelProperty("线索id")
private String partnerLineId;
@ApiModelProperty("会销id")
private Integer exhibitionId;
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:57
* @Version 1.0
*/
@Data
public class ExhibitionGroupDTO {
private Integer exhibitionGroupId;
private String exhibitionGroupName;
private List<ExhibitionDTO> exhibitionList;
}

View File

@@ -0,0 +1,23 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/8 16:56
* @Version 1.0
*/
@Data
public class ExhibitionLineBaseDTO {
private String partnerName;
private String mobile;
private String partnerId;
private Integer participationStatus;
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/6 17:13
* @Version 1.0
*/
@Data
public class ExhibitionLineDTO {
private String partnerId;
private String partnerName;
private String mobile;
private String exhibitionId;
private Integer lineId;
private Integer wantShopArea;
private Integer wantShopAreaName;
private Integer participationStatus;
private String channelName;
private Integer id;
private Integer expectedVisitorsCount;
private String expectedInformation;
private String customerManager;
}

View File

@@ -0,0 +1,48 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/5 16:53
* @Version 1.0
*/
@Data
public class ExhibitionStatisticsDTO {
/**
* 展会code
*/
private String exhibitionCode;
/**
* 报名人数
*/
private Integer signUpCount;
/**
* 签到人数
*/
private Integer checkInCount;
/**
*
* 意向申请填写人数
*/
private Integer formFillCount;
/**
* 面试人数
*/
private Integer interviewCount;
public ExhibitionStatisticsDTO(){
this.checkInCount = 0;
this.signUpCount = 0;
this.formFillCount = 0;
this.interviewCount = 0;
}
}

View File

@@ -0,0 +1,43 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/5 20:16
* @Version 1.0
*/
@Data
public class MyExhibitionGroupDTO {
/**
* 会销组名称
*/
private String exhibitionGroupName;
/**
* 会销组ID
*/
private Integer id;
/**
* 创建人ID
*/
private String createId;
/**
* 创建人名称
*/
private String createName;
/**
* 创建人手机号
*/
private String mobile;
/**
* 是否结束
*/
private Integer closed;
}

View File

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

View File

@@ -0,0 +1,26 @@
package com.cool.store.dto.log;
import lombok.Builder;
import lombok.Data;
/**
* @author Fun Li 2023/12/12 15:48
* @version 1.0
*/
@Data
@Builder
public class ApproveAppointmentDTO {
private String operateTime;
private String operateUsername;
private String operateUserId;
private String mobile;
private String rawInterviewDateTime;
private String interviewPlanId;
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.dto.log;
import lombok.Builder;
import lombok.Data;
/**
* @author Fun Li 2023/12/12 17:53
* @version 1.0
*/
@Data
@Builder
public class AutoOpenInterviewRoomDTO {
private String operateTime;
}

View File

@@ -0,0 +1,26 @@
package com.cool.store.dto.partner;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/7 16:28
* @Version 1.0
*/
@Data
public class LineInterviewDTO {
private Integer lineId;
private String investmentManager;
private String investmentManagerName;
private String investmentManagerMobile;
private String interviewer;
private String interviewerName;
private String interviewerMobile;
}

View File

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

View File

@@ -65,6 +65,9 @@ public class PartnerLineInfoAndBaseInfoDTO {
private Integer lineStatus;
@ApiModelProperty("是否处在会销中")
private Boolean whetherInExhibition;
@ApiModelProperty("常驻区域")
private String liveArea;

View File

@@ -63,6 +63,9 @@ public class PrivateSeaLineDTO {
@ApiModelProperty("线索状态")
private Integer lineStatus;
@ApiModelProperty("是否在会销中")
private Boolean whetherInExhibition;
@ApiModelProperty("推荐加盟商ID")
private String recommendPartnerId;

View File

@@ -0,0 +1,64 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-11-30 11:47
*/
@Table(name = "hy_exhibition")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HyExhibitionDO implements Serializable {
@ApiModelProperty("")
private Integer id;
@ApiModelProperty("关联会销组idhy_exhibition_group.id")
private Integer exhibitionGroupId;
@ApiModelProperty("会销编号")
private String exhibitionCode;
@ApiModelProperty("会销名称")
private String exhibitionName;
@ApiModelProperty("举办日期")
private Date startDate;
@ApiModelProperty("举办地点")
private String location;
@ApiModelProperty("0表示未结束1表示自动结束2表示手动结束")
private Integer closedType;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("创建人user_identerprise_user.user_id")
private String creator;
@ApiModelProperty("更新人user_identerprise_user.user_id")
private String updater;
@ApiModelProperty("删除标志0表示未删除")
private Boolean deleted;
@ApiModelProperty("结束时间")
private Date closeTime;
@ApiModelProperty("协作人user_identerprise_user.user_id以英文逗号分隔")
private String collaborators;
}

View File

@@ -0,0 +1,46 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-11-30 11:55
*/
@Table(name = "hy_exhibition_group")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HyExhibitionGroupDO implements Serializable {
@ApiModelProperty("")
private Integer id;
@ApiModelProperty("会销组名称20个字")
private String exhibitionGroupName;
@ApiModelProperty("0表示未结束1表示结束")
private Boolean closed;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("创建人user_identerprise_user.user_id")
private String creator;
@ApiModelProperty("更新人user_identerprise_user.user_id")
private String updater;
@ApiModelProperty("删除标志0表示未删除")
private Boolean deleted;
}

View File

@@ -0,0 +1,70 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-11-30 11:55
*/
@Table(name = "hy_partner_exhibition")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HyPartnerExhibitionDO implements Serializable {
@ApiModelProperty("")
private Long id;
@ApiModelProperty("报名的展会idhy_exhibition.id")
private Integer exhibitionId;
@ApiModelProperty("线索idhy_partner_line_info.id")
private Long partnerLineId;
@ApiModelProperty("hy_partner_user_info.partner_id")
private String partnerId;
@ApiModelProperty("意向开店区域")
private String wantShopArea;
@ApiModelProperty("客户经理名字")
private String investmentManagerName;
@ApiModelProperty("预计到访人数")
private Integer expectedVisitorsCount;
@ApiModelProperty("期望了解的信息")
private String expectedInformation;
@ApiModelProperty("参加会销状态0为已报名1为已签到2为已提交申请3为面试中4为面试完成5为通过6为不通过7为取消报名")
private Integer participationStatus;
@ApiModelProperty("线索参加的面试计划idhy_partner_interview_plan.id")
private Long interviewPlanId;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("签到时间")
private Date checkInTime;
@ApiModelProperty("创建人user_identerprise_user.user_id")
private String creator;
@ApiModelProperty("更新人user_identerprise_user.user_id")
private String updater;
@ApiModelProperty("删除标识0标识未删除")
private Boolean deleted;
}

View File

@@ -0,0 +1,26 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/12/7 18:12
* @version 1.0
* 线索参加会销面试相关信息
*/
@Data
public class HyPartnerExhibitionInterviewDO {
@ApiModelProperty("会销id")
private Integer exhibitionId;
@ApiModelProperty("会销名")
private String exhibitionName;
@ApiModelProperty("会销日期")
private String exhibitionDate;
@ApiModelProperty("面试计划id")
private Long interviewPlanId;
}

View File

@@ -35,6 +35,9 @@ public class HyPartnerLineInfoDO implements Serializable {
@ApiModelProperty("线索状态:0公海线索;1跟进中;2合作中;3黑名单")
private Integer lineStatus;
@ApiModelProperty("是否处在会销中")
private Boolean whetherInExhibition;
@ApiModelProperty("招商经理")
private String investmentManager;

View File

@@ -83,6 +83,9 @@ public class PrivateSeaLineListRequest extends PageInfoRequest {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("是否会销中")
private Boolean whetherInExhibition;
/**
* deadline 截至时间
* updateTime 更新时间

View File

@@ -8,8 +8,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import java.util.ArrayList;
import java.util.Date;
@@ -84,6 +84,12 @@ public class PrivateSeaLineListVo {
@ApiModelProperty("线索状态")
private Integer lineStatus;
@ApiModelProperty("是否在会销中")
private Boolean whetherInExhibition;
@ApiModelProperty("是否处于会销面试中")
private Boolean whetherExhibitionInterview;
@ApiModelProperty("推荐加盟商ID")
private String recommendPartnerId;
@@ -108,12 +114,14 @@ public class PrivateSeaLineListVo {
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap,
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap,Map<Integer, String> channelMap,Map<Long, String> userPortraitMap){
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap,Map<Integer, String> channelMap,Map<Long, String> userPortraitMap,
List<Long> exhibitionInterviewLines){
List<PrivateSeaLineListVo> resultList = new ArrayList<>();
for (PrivateSeaLineDTO x : list) {
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
privateSeaLineListVo.setLineId(x.getLineId());
privateSeaLineListVo.setLineStatus(x.getLineStatus());
privateSeaLineListVo.setWhetherInExhibition(x.getWhetherInExhibition());
privateSeaLineListVo.setPartnerId(x.getPartnerId());
privateSeaLineListVo.setWorkflowStatus(x.getWorkflowStatus());
String deadLine = DateUtil.format(x.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_2);
@@ -161,6 +169,13 @@ public class PrivateSeaLineListVo {
}
}
}
//在会销面试中的线索
privateSeaLineListVo.setWhetherExhibitionInterview(Boolean.FALSE);
if (privateSeaLineListVo.getWhetherInExhibition()
&& ObjectUtils.isNotEmpty(exhibitionInterviewLines)
&& exhibitionInterviewLines.contains(x.getLineId())) {
privateSeaLineListVo.setWhetherExhibitionInterview(Boolean.TRUE);
}
privateSeaLineListVo.setUserPortraitList(userPortraitList);
resultList.add(privateSeaLineListVo);
}

View File

@@ -0,0 +1,26 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:30
* @Version 1.0
*/
@Data
public class CollaboratorVO {
private String collaborateId;
private String collaborateName;
public CollaboratorVO(String collaborateId, String collaborateName) {
this.collaborateId = collaborateId;
this.collaborateName = collaborateName;
}
public CollaboratorVO() {
this.collaborateId = collaborateId;
this.collaborateName = collaborateName;
}
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/6 16:05
* @Version 1.0
*/
@Data
public class ExhibitionDetailVO extends ExhibitionVO{
private String createTime;
private String closeTime;
private String createId;
private String createName;
private String mobile;
private Integer closedType;
}

View File

@@ -0,0 +1,20 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/12/6 10:03
* @Version 1.0
*/
@Data
public class ExhibitionGroupDetailVO {
private String exhibitionGroupName;
private Integer id;
private List<ExhibitionVO> exhibitionList;
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:57
* @Version 1.0
*/
@Data
public class ExhibitionGroupVO {
private Integer exhibitionGroupId;
private String exhibitionGroupName;
private List<ExhibitionVO> exhibitionList;
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/8 16:54
* @Version 1.0
*/
@Data
public class ExhibitionLineBaseVO {
private String partnerName;
private String mobile;
private String partnerId;
private Integer participationStatus;
}

View File

@@ -0,0 +1,51 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/6 17:13
* @Version 1.0
*/
@Data
public class ExhibitionLineVO {
private String partnerId;
private String partnerName;
private String mobile;
private String exhibitionId;
private Integer lineId;
private Integer wantShopArea;
private Integer wantShopAreaName;
private Integer participationStatus;
private String channelName;
private Integer id;
private Integer expectedVisitorsCount;
private String expectedInformation;
private String investmentManager;
private String investmentManagerName;
private String investmentManagerMobile;
private String customerManager;
private String interviewer;
private String interviewerName;
private String interviewerMobile;
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/11/30 15:33
* @Version 1.0
*/
@Data
public class ExhibitionVO {
private String exhibitionName;
private String location;
private String startDate;
private Integer id;
private List<CollaboratorVO> collaborators;
}

View File

@@ -0,0 +1,56 @@
package com.cool.store.vo.exhibition;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/12/5 20:20
* @Version 1.0
*/
@Data
public class MyExhibitionGroupVO {
/**
* 会销组名称
*/
private String exhibitionGroupName;
/**
* 失效时间
*/
private String expiresTime;
/**
* 会销组ID
*/
private Integer id;
/**
* 创建人ID
*/
private String createId;
/**
* 创建人名称
*/
private String createName;
/**
* 创建人手机号
*/
private String mobile;
/**
* 是否结束
*/
private Integer closed;
/**
* 会销 列表
*/
private List<ExhibitionVO> exhibitionList;
}

View File

@@ -0,0 +1,40 @@
package com.cool.store.vo.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/5 10:41
* @Version 1.0
*/
@Data
public class MyExhibitionVO extends ExhibitionVO{
/**
* 结束类型 0-未结算 1-自动结束 2-手动结束
*/
private Integer closedType;
/**
* 报名人数
*/
private Integer signUpCount;
/**
* 签到人数
*/
private Integer checkInCount;
/**
*
* 意向申请填写人数
*/
private Integer formFillCount;
/**
* 面试人数
*/
private Integer interviewCount;
}

View File

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

View File

@@ -136,4 +136,13 @@ public class InterviewVO {
@ApiModelProperty("该时段是否是自己预约的(不一定代表预约成功)")
private Boolean selfBooked;
@ApiModelProperty("是否是通过会销进行的面试")
private Boolean whetherExhibitionInterview;
@ApiModelProperty("参加的相应展会名称")
private String exhibitionName;
@ApiModelProperty("展会日期")
private String exhibitionDate;
}

View File

@@ -25,11 +25,14 @@ import java.util.List;
@Component
public class RedisUtilConfig {
@Value("${redis.host.uri}")
private String REDIS_HOST_URI;
@Value("${redis.host}")
private String host;
private String REDIS_HOST;
@Value("${redis.password}")
private String password;
private String REDIS_PASSWORD;
@Bean
public RedisUtilPool redisUtilPool() {
@@ -43,8 +46,8 @@ public class RedisUtilConfig {
jedisPoolConfig.setTestOnBorrow(false);
List<JedisShardInfo> shards = new ArrayList<>();
JedisShardInfo jedisShardInfo = new JedisShardInfo(host);
jedisShardInfo.setPassword(password);
JedisShardInfo jedisShardInfo = new JedisShardInfo(REDIS_HOST);
jedisShardInfo.setPassword(REDIS_PASSWORD);
shards.add(jedisShardInfo);
redisUtil.setShardedJedisPool(new ShardedJedisPool(jedisPoolConfig, shards));
return redisUtil;

View File

@@ -0,0 +1,24 @@
package com.cool.store.job;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author Fun Li 2023/12/8 13:50
* @version 1.0
*/
@Slf4j
@Component
public class ExhibitionJob {
@XxlJob("finishExhibition")
public void syncUserSourceJob() {
XxlJobHelper.log("-------------------------------自动结束会销任务开始-------------------------------");
XxlJobHelper.log("-------------------------------自动结束会销任务结束-------------------------------");
XxlJobHelper.handleSuccess();
}
}

View File

@@ -0,0 +1,115 @@
package com.cool.store.service;
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.*;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* @author Fun Li 2023/11/30 14:42
* @version 1.0
*/
public interface ExhibitionService {
/**
* 会销开始面试
* @param dto
* @return
*/
EnterInterviewVO startExhibitionInterview(ExhibitionEnterInterviewDTO dto) throws ApiException;
/**
* 新增会销组
* xin
* @param exhibitionGroupDTO
* @param userInfo
* @return
* @throws ApiException
*/
Boolean addExhibitionGroup(ExhibitionGroupDTO exhibitionGroupDTO, LoginUserInfo userInfo) throws ApiException;
/**
* 编辑会销组
* x
* @param exhibitionGroupDTO
* @param userInfo
* @return
*/
Boolean editExhibitionGroup(ExhibitionGroupDTO exhibitionGroupDTO, LoginUserInfo userInfo) throws ApiException;
/**
* 我的会销
* x
* @param userId 用户ID
* @param pageSize 分页大小
* @param pageNum 页码
* @return
*/
PageInfo<MyExhibitionVO> getMyExhibitionList(String userId,String startDate,String closedType,Integer pageSize,Integer pageNum);
/**
* 我创建的会销组
* @param userId
* @param pageSize
* @param pageNum
* @return
*/
PageInfo<MyExhibitionGroupVO> getMyExhibitionGroupList(String userId,Integer pageSize,Integer pageNum);
/**
* 会销组详情
* @param exhibitionGroupId
* @return
*/
ExhibitionGroupDetailVO getExhibitionGroupDetail(Integer exhibitionGroupId);
/**
* 会销详情
* @param exhibitionId
* @return
*/
ExhibitionDetailVO getExhibitionDetail(Integer exhibitionId);
/**
* 编辑会销
* @param exhibitionDTO
* @param userInfo
* @return
*/
Boolean editExhibition(ExhibitionDTO exhibitionDTO,LoginUserInfo userInfo) ;
/**
* getExhibitionLineList
* @param exhibitionId
* @param participationStatus
* @param PartnerUserId
* @param pageSize
* @param pageNum
* @return
*/
PageInfo<ExhibitionLineVO> getExhibitionLineList(Integer exhibitionId,Integer participationStatus, String PartnerUserId ,Integer pageSize,Integer pageNum,String userId);
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);
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.exception.ApiException;
import com.cool.store.request.*;
import com.cool.store.vo.EnterInterviewVO;
@@ -9,6 +10,7 @@ import com.cool.store.vo.interview.GetFreeBusyListVO;
import com.cool.store.vo.interview.InterviewVO;
import java.util.List;
import java.util.Map;
/**
* @Author: young.yu
@@ -50,13 +52,6 @@ public interface InterviewService {
*/
EnterInterviewVO enterInterviewRoom(EnterInterviewDto dto) throws ApiException;
/**
* 创建面试预约信息
* @param request
* @return
*/
CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException;
/**
* 同意面试预约
* @param request
@@ -84,4 +79,14 @@ public interface InterviewService {
* @param request {@link com.cool.store.request.CreateAppointmentReq}
*/
CreateAppointmentVO bookInterview(CreateAppointmentReq request) throws ApiException;
/**
* 直接进入面试待开始或已开始阶段,无需线索预约面试
* @param request {@link CreateAppointmentReq}
* @param whetherBeginInterview 是否直接开始面试
* @param interviewerId 面试官 userId
* @return interview: {@link com.cool.store.entity.HyPartnerInterviewDO}; interviewPlan: {@link com.cool.store.entity.HyPartnerInterviewPlanDO}
* @throws ApiException
*/
Map<String, Object> agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId) throws ApiException;
}

View File

@@ -3,11 +3,13 @@ package com.cool.store.service;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.dto.partner.LineQueryInterviewDto;
import com.cool.store.exception.ApiException;
import com.cool.store.request.CreateAppointmentReq;
import com.cool.store.request.GetFreeBusyListReq;
import com.cool.store.request.ModifyInterviewTimeReq;
import com.cool.store.vo.EnterInterviewVO;
import com.cool.store.vo.PartnerInterviewInfoVO;
import com.cool.store.vo.PartnerPassLetterDetailVO;
import com.cool.store.vo.interview.CreateAppointmentVO;
import com.cool.store.vo.interview.GetFreeBusyListVO;
public interface PartnerInterviewService {
@@ -47,4 +49,11 @@ public interface PartnerInterviewService {
* @return {@link GetFreeBusyListVO}
*/
GetFreeBusyListVO getFreeBusyList(GetFreeBusyListReq request);
/**
* 预约面试方法
* @param request
* @return
*/
CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException;
}

View File

@@ -2,14 +2,13 @@ package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.HyPartnerExhibitionDAO;
import com.cool.store.dto.log.LogFieldDTO;
import com.cool.store.entity.HyPartnerCertificationInfoDO;
import com.cool.store.entity.HyPartnerExhibitionDO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.entity.HyPartnerTaskInfoLogDO;
import com.cool.store.enums.OperateLogFieldValueEnum;
import com.cool.store.enums.OperateTypeEnum;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.enums.*;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyPartnerCertificationInfoMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
@@ -45,6 +44,9 @@ public class CommonServiceImpl implements CommonService {
@Autowired
private HyPartnerCertificationInfoMapper hyPartnerCertificationInfoMapper;
@Autowired
private HyPartnerExhibitionDAO partnerExhibitionDAO;
@Override
public String getTipsInfo(GetTipsInfoReq request) throws ApiException {
List<HyPartnerLineInfoDO> lineInfoList = hyPartnerLineInfoMapper.getHyPartnerLineInfoListByIds(Arrays.asList(Long.parseLong(request.getPartnerLineId())));
@@ -55,53 +57,99 @@ public class CommonServiceImpl implements CommonService {
String workflowStage = hyPartnerLineInfoDO.getWorkflowStage();
String workflowStatus = hyPartnerLineInfoDO.getWorkflowStatus();
Long partnerLineId = hyPartnerLineInfoDO.getId();
if ((workflowStage.equals(WorkflowStageEnum.RESERVATION.getCode()) && workflowStatus.equals(WorkflowStatusEnum.RESERVATION_1.getCode()))||
(workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_2.getCode()))) {
String interviewAppointmentTips = getInterviewTips(partnerLineId, OperateTypeEnum.INTERVIEW_APPOINTMENT, "提交面试预约时间");
if (StringUtils.isEmpty(interviewAppointmentTips)) {
interviewAppointmentTips = getInterviewTips(partnerLineId, OperateTypeEnum.INTERVIEWER_BOOK_INTERVIEW, "提交面试预约时间");
//会销面试信息
HyPartnerExhibitionDO partnerExhibitionDO = new HyPartnerExhibitionDO();
partnerExhibitionDO.setPartnerLineId(hyPartnerLineInfoDO.getId());
partnerExhibitionDO.setDeleted(Boolean.FALSE);
partnerExhibitionDO.setParticipationStatus(ExhibitionPartnerStatus.INTERVIEWING.getCode());
partnerExhibitionDO = partnerExhibitionDAO.querySelective(partnerExhibitionDO);
//是否是会销面试
if (partnerExhibitionDO == null || partnerExhibitionDO.getParticipationStatus().compareTo(ExhibitionPartnerStatus.INTERVIEWING.getCode()) < 0) {
return getCommonTipsInfo(workflowStage, workflowStatus, partnerLineId);
} else {
return getExhibitionTipsInfo(workflowStage, workflowStatus, partnerLineId);
}
}
//普通线索
private String getCommonTipsInfo(String workflowStage, String workflowStatus, Long partnerLineId) {
String interviewTips = "";
//1. 预约面试待审核
if ((workflowStage.equals(WorkflowStageEnum.RESERVATION.getCode()) && workflowStatus.equals(WorkflowStatusEnum.RESERVATION_1.getCode()))) {
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.MODIFY_INTERVIEW_TIME, "", "修改面试预约时间");
if (StringUtils.isEmpty(interviewTips)) {
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.INTERVIEW_APPOINTMENT, "通过合伙人小程序于", "发起预约面试申请");
}
return interviewAppointmentTips;
//2. 待面试
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_2.getCode())) {
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.INTERVIEW_APPOINTMENT_AGREEMENT, "", "同意了客户的预约面试申请");
//3. 面试已开始
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_3.getCode())) {
String tips = getInterviewTips(partnerLineId, OperateTypeEnum.MODIFY_INTERVIEW_TIME, "");
if (StringUtils.isNotEmpty(tips)) {
return tips + ("修改面试预约时间");
} else {
String interviewAppointmentTips = getInterviewTips(partnerLineId, OperateTypeEnum.INTERVIEW_APPOINTMENT, "提交面试预约时间");
if (StringUtils.isEmpty(interviewAppointmentTips)) {
interviewAppointmentTips = getInterviewTips(partnerLineId, OperateTypeEnum.INTERVIEWER_BOOK_INTERVIEW, "提交面试预约时间");
}
return interviewAppointmentTips;
}
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.AUTO_OPEN_INTERVIEW, "面试房间于", "正式开放");
interviewTips = interviewTips.trim();
//4. 面试已结束
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_4.getCode())) {
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "结束面试");
}else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_5.getCode())) {
return getInterviewTips(partnerLineId, OperateTypeEnum.CREATE_QUALIFYVERIFY, "发起加盟商资质审核");
}else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_6.getCode())) {
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "", "结束面试");
//5. 发起资质审批
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_5.getCode())) {
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.CREATE_QUALIFYVERIFY, "","发起加盟商资质审核");
//6. 资质审批通过
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_6.getCode())) {
HyPartnerCertificationInfoDO partnerCertificationInfoDO = hyPartnerCertificationInfoMapper.selectByPartnerLineId(partnerLineId);
String intentionContractNo = null;
if(partnerCertificationInfoDO != null){
intentionContractNo = partnerCertificationInfoDO.getIntentionContractNo();
}
return getVerifyResultTips(partnerLineId, OperateTypeEnum.QUALIFYVERIFY_PASS, "审核通过 | "+intentionContractNo);
interviewTips = getVerifyResultTips(partnerLineId, OperateTypeEnum.QUALIFYVERIFY_PASS, "审核通过 | " + intentionContractNo);
}
return null;
return interviewTips;
}
public String getInterviewTips(Long partnerLineId, OperateTypeEnum operateTypeEnum, String action) {
StringBuffer sb = new StringBuffer();
//会销面试线索,通过会销进行面试的线索已开始就是面试已开始状态
private String getExhibitionTipsInfo(String workflowStage, String workflowStatus, Long partnerLineId) {
String interviewTips = "";
//1. 面试已开始
if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_3.getCode())) {
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.INTERVIEWER_BOOK_INTERVIEW, "通过展会于", "发起面试");
//2. 面试已结束
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_4.getCode())) {
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "通过展会于", "结束面试");
//3. 发起资质审批
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_5.getCode())) {
// TODO 判断是否是通过会销发起的
interviewTips = getInterviewTips(partnerLineId, OperateTypeEnum.EXHIBITION_CREATE_QUALIFYVERIFY, "通过展会于", "发起加盟商资质审核");
if (interviewTips == null) {
getInterviewTips(partnerLineId, OperateTypeEnum.CREATE_QUALIFYVERIFY, "", "发起加盟商资质审核");
}
//4. 资质审批通过
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_6.getCode())) {
HyPartnerCertificationInfoDO partnerCertificationInfoDO = hyPartnerCertificationInfoMapper.selectByPartnerLineId(partnerLineId);
String intentionContractNo = null;
if(partnerCertificationInfoDO != null){
intentionContractNo = partnerCertificationInfoDO.getIntentionContractNo();
}
interviewTips = getVerifyResultTips(partnerLineId, OperateTypeEnum.QUALIFYVERIFY_PASS, "审核通过 | "+intentionContractNo);
}
return interviewTips;
}
public String getInterviewTips(Long partnerLineId, OperateTypeEnum operateTypeEnum, String middleInfo, String action) {
StringBuilder sb = new StringBuilder();
sb.append(StringUtil.REPLACE_0)
.append(" ")
.append(StringUtil.REPLACE_1)
.append(" ").append(StringUtil.REPLACE_2).append(" ").append(action);
.append(" ")
.append(middleInfo)
.append(" ")
.append(StringUtil.REPLACE_2)
.append(" ").append(action);
String content = sb.toString();
return getSuitableTipsInfo(content, partnerLineId,
operateTypeEnum,
OperateLogFieldValueEnum.OPERATE_USER_NAME.getCode(),
OperateLogFieldValueEnum.MOBILE.getCode(),
OperateLogFieldValueEnum.OPERATE_TIME.getCode());
}
public String getVerifyResultTips(Long partnerLineId, OperateTypeEnum operateTypeEnum, String action) {
@@ -132,7 +180,6 @@ public class CommonServiceImpl implements CommonService {
} catch (Exception e) {
//异常代表不是时间格式,不做处理
}
}
params.add(value);
}

View File

@@ -82,7 +82,7 @@ public class DeskServiceImpl implements DeskService {
if (StringUtils.isEmpty(userId)||selectedData==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
Date dateTime = CoolDateUtils.parseDate(selectedData);
Date dateTime = CoolDateUtils.parseDate(selectedData,CoolDateUtils.DATE_FORMAT_SEC);
InterviewScheduleInfoVO interviewScheduleInfoVO = new InterviewScheduleInfoVO();
//查询面试数量

View File

@@ -2,16 +2,16 @@ package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.*;
import com.cool.store.dto.log.AutoOpenInterviewRoomDTO;
import com.cool.store.dto.message.RemindInterviewMsgDTO;
import com.cool.store.dto.message.SendCardMessageDTO;
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.exception.ApiException;
import com.cool.store.http.EventCenterHttpRequest;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
@@ -81,6 +81,9 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
@Resource
HyPartnerUserChannelDAO hyPartnerUserChannelDAO;
@Autowired
private HyPartnerExhibitionDAO partnerExhibitionDAO;
@Autowired
private EventCenterHttpRequest eventCenterHttpRequest;
@@ -96,6 +99,9 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
@Autowired
private WechatMiniAppService wechatMiniAppService;
@Autowired
private LogService logService;
@Override
public List<InterviewDetailInfoVO> getInterviewPlanList(String userId,Date dateTime) {
String currentDay = DateUtil.format(dateTime, CoolDateUtils.DATE_FORMAT_DAY);
@@ -106,15 +112,21 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
}
List<String> partnerIdList = interviewPlanList.stream().map(HyPartnerInterviewPlanDO::getPartnerId).collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIdList);
List<Long> interviewPlanIds = interviewPlanList.stream().map(HyPartnerInterviewPlanDO::getId).collect(Collectors.toList());
List<Long> exhibitionInterviewPlanIds = partnerExhibitionDAO.queryListByInterviewPlanIds(interviewPlanIds);
Map<String, HyPartnerUserInfoDO> hyPartnerUserInfoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data));
List<InterviewDetailInfoVO> result = new ArrayList<>();
interviewPlanList.stream().forEach(x->{
InterviewDetailInfoVO interviewDetailInfoVO = convertDoToInterviewDetailInfoVO(x);
HyPartnerUserInfoDO userInfoDO = hyPartnerUserInfoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
interviewDetailInfoVO.setUserId(userInfoDO.getPartnerId());
interviewDetailInfoVO.setUserName(userInfoDO.getUsername());
interviewDetailInfoVO.setUserPhone(userInfoDO.getMobile());
result.add(interviewDetailInfoVO);
interviewPlanList.stream()
//去掉在会销中进行的面试
.filter(interviewPlan -> !exhibitionInterviewPlanIds.contains(interviewPlan.getId()))
.collect(Collectors.toList())
.forEach(x->{
InterviewDetailInfoVO interviewDetailInfoVO = convertDoToInterviewDetailInfoVO(x);
HyPartnerUserInfoDO userInfoDO = hyPartnerUserInfoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
interviewDetailInfoVO.setUserId(userInfoDO.getPartnerId());
interviewDetailInfoVO.setUserName(userInfoDO.getUsername());
interviewDetailInfoVO.setUserPhone(userInfoDO.getMobile());
result.add(interviewDetailInfoVO);
});
return result;
}
@@ -257,6 +269,14 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
List<Long> lineIds = waitForOpenInterviewLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
hyPartnerInterviewPlanMapper.openInterviewRoom(lineIds,RoomStatus.OPEN.getCode());
interviewDAO.batchUpdateInterviewWorkflowStatus(lineIds,Integer.parseInt(WorkflowStatusEnum.INTERVIEW_3.getCode()));
//记录日志
LoginUserInfo user = CurrentUserHolder.getUser();
AutoOpenInterviewRoomDTO autoOpenInterviewRoomLog = AutoOpenInterviewRoomDTO.builder()
.operateTime(DateUtil.now()).build();
for (Long lineId : lineIds) {
logService.recordBizLog(user, lineId, OperateTypeEnum.AUTO_OPEN_INTERVIEW, autoOpenInterviewRoomLog);
}
}
@Override

View File

@@ -85,6 +85,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
@Resource
HyPartnerUserChannelDAO hyPartnerUserChannelDAO;
@Autowired
private HyPartnerExhibitionDAO partnerExhibitionDAO;
// @Autowired
// private NoticeService noticeService;
@Autowired
@@ -513,8 +516,12 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
hyPartnerLineInfoDO.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
hyPartnerLineInfoDO.setCloseTime(new Date());
hyPartnerLineInfoDO.setCloseUserId(user.getUserId());
//是否参加会销(这里做更新只是为了数据一致性,实际应该没必要)
hyPartnerLineInfoDO.setWhetherInExhibition(Boolean.FALSE);
//作废待完成&已逾期的任务
hyFollowTaskDAO.cancelUndoFollowTask(closeFollowRequest.getLineId());
//标记删除线索参加的会销信息
partnerExhibitionDAO.deleteAllByLineId(closeFollowRequest.getLineId());
//各阶段单独的逻辑
workFlowService.endProcess(WorkflowStageEnum.getWorkflowStageByCode(hyPartnerLineInfoDO.getWorkflowStage()), closeFollowRequest);
}
@@ -661,6 +668,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
return privateLineList;
}
List<Long> lindIds = list.stream().map(PrivateSeaLineDTO::getLineId).collect(Collectors.toList());
//查询处在会销面试中的线索
List<Long> exhibitionInterviewLines = partnerExhibitionDAO.queryListByLineIds(lindIds);
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanDAO.getHyPartnerInterviewPlanByLineIds(lindIds);
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap = hyPartnerInterviewPlanDOS.stream().collect(Collectors.toMap(HyPartnerInterviewPlanDO::getPartnerLineId, data -> data));
@@ -679,7 +688,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait())).map(PrivateSeaLineDTO::getUserPortrait).collect(Collectors.toList());
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap, hyPartnerInterviewPlanDOMap, channelMap, userPortraitMap);
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap, hyPartnerInterviewPlanDOMap, channelMap, userPortraitMap, exhibitionInterviewLines);
privateLineList.setList(result);
return privateLineList;
}

View File

@@ -7,11 +7,10 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyIntendDevMappingDAO;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.calendar.*;
import com.cool.store.dao.HyPartnerExhibitionDAO;
import com.cool.store.dto.log.*;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.entity.*;
@@ -19,16 +18,20 @@ import com.cool.store.enums.*;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.EventCenterHttpRequest;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.mapper.*;
import com.cool.store.mapper.HyPartnerBaseInfoMapper;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.request.*;
import com.cool.store.service.*;
import com.cool.store.service.EnterpriseUserService;
import com.cool.store.service.InterviewService;
import com.cool.store.service.LogService;
import com.cool.store.service.WechatMiniAppService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.TRTCUtils;
import com.cool.store.vo.EnterInterviewVO;
import com.cool.store.vo.EnterpriseUserBaseInfoVO;
import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.interview.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@@ -57,21 +60,12 @@ public class InterviewServiceImpl implements InterviewService {
@Value("${trtc.secretKey:null}")
private String key;
@Value("${hs.sms.templateCode:null}")
private String templateCode;
@Value("${feishu.notice.link.url}")
private String linkUrl;
@Autowired
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
@Autowired
private HyPartnerInterviewMapper hyPartnerInterviewMapper;
@Autowired
private ISVHttpRequest isvHttpRequest;
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
@@ -81,10 +75,11 @@ public class InterviewServiceImpl implements InterviewService {
@Autowired
private HyInterviewDAO hyInterviewDAO;
@Autowired
private HyPartnerExhibitionDAO partnerExhibitionDAO;
@Autowired
private EnterpriseUserService enterpriseUserService;
// @Autowired
// private SmsService smsService;
@Autowired
private HyInterviewDAO interviewDAO;
@@ -141,15 +136,32 @@ public class InterviewServiceImpl implements InterviewService {
//查询所属战区
String wantShopArea = hyPartnerLineInfoMapper.getAffiliationZoneIdByInterviewPlanId(interviewPlanId);
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = hyIntendDevMappingDAO.selectByOpenAreaMappingId(Long.valueOf(wantShopArea), "dev");
if (hyIntendDevelopementMappingDO == null) {
return vo;
if (hyIntendDevelopementMappingDO != null) {
//查询开发主管
EnterpriseUserDO development = enterpriseUserService.getDevelopmentByZoneId(hyIntendDevelopementMappingDO.getMappingId());
vo.setDevelopmentDirector(development);
}
//查询开发主管
EnterpriseUserDO development = enterpriseUserService.getDevelopmentByZoneId(hyIntendDevelopementMappingDO.getMappingId());
vo.setDevelopmentDirector(development);
}
//3. 查询该时段预约情况
//3. 查询线索参加会销面试情况
//只有在面试开始阶段以后才有该信息
if (//线索在面试阶段且已开始面试
(vo.getWorkflowStage().equals(Long.parseLong(WorkflowStageEnum.INTERVIEW.getCode())) && vo.getStatus().compareTo(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_3.getCode())) >= 0)
//线索在面试阶段后
|| vo.getWorkflowStage().compareTo(Long.parseLong(WorkflowStageEnum.INTERVIEW.getCode())) >= 0) {
HyPartnerExhibitionDO partnerExhibitionDO = new HyPartnerExhibitionDO();
partnerExhibitionDO.setInterviewPlanId(Long.parseLong(vo.getInterviewPlanId()));
partnerExhibitionDO.setDeleted(Boolean.FALSE);
partnerExhibitionDO.setPartnerLineId(vo.getPartnerLineId());
HyPartnerExhibitionInterviewDO partnerExhibitionInterview = partnerExhibitionDAO.queryPartnerExhibitionInterviewInfo(Long.parseLong(vo.getInterviewPlanId()), vo.getPartnerLineId());
if (partnerExhibitionInterview != null) {
vo.setWhetherExhibitionInterview(Boolean.TRUE);
vo.setExhibitionName(partnerExhibitionInterview.getExhibitionName());
vo.setExhibitionDate(partnerExhibitionInterview.getExhibitionDate());
}
}
//4. 查询该时段预约情况
//如果还未提交预约申请就没有预约情况,面试完成以后也必要查询了
if (!vo.getStatus().equals(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_2.getCode()))
&& !vo.getStatus().equals(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_3.getCode()))
@@ -163,6 +175,7 @@ public class InterviewServiceImpl implements InterviewService {
vo.setSelfBooked(Boolean.TRUE);
vo.setAppointmentCount(bookSituation.getBookingCount());
}
return vo;
}
@@ -459,98 +472,6 @@ public class InterviewServiceImpl implements InterviewService {
}
}
@Override
@Transactional
public CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException {
if(request.getPartnerLineId() == null || request.getPartnerLineId()<=0){
throw new ApiException(ErrorCodeEnum.INTERVIEW_LINE_ID_IS_NULL);
}
//如果开始时间小于当前时间需要报错
// if(DateUtil.date().isAfter(DateUtil.parse(request.getStartBookingTime()))){
// throw new ApiException(ErrorCodeEnum.CREATE_APPOINTMENT_TIME_ERROR);
// }
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewPlanDO.setDeleted(false);
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isNotEmpty(hyPartnerInterviewPlanDOS)&&hyPartnerInterviewPlanDOS.get(0).getId()!=null){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
String interviewrId = request.getInterviewerId();
if(StringUtils.isEmpty(interviewrId)){
interviewrId = getInterviewerByPartner(request.getPartnerId(),String.valueOf(request.getPartnerLineId()));
}
CreateAppointmentVO vo = new CreateAppointmentVO();
//1.创建面试计划
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
String startBookingTime = request.getStartBookingTime();
String startDate = startBookingTime.substring(0, 10);
record.setInterviewDate(Convert.toDate(startDate));
record.setCreateTime(new Date());
record.setUpdateTime(new Date());
record.setStartTime(Convert.toDate(request.getStartBookingTime()));
record.setEndTime(Convert.toDate(request.getEndBookingTime()));
record.setPartnerId(request.getPartnerId());
record.setPartnerLineId(request.getPartnerLineId());
record.setInterviewer(interviewrId);
record.setIsPartnerInterview(0);
//生成房间号
record.setRoomId(StringUtil.generateRoomId(startBookingTime));
record.setRoomStatus(RoomStatus.WAIT_FOR_OPEN.getCode());
record.setDeleted(false);
record.setApplicationApproved(0);
hyPartnerInterviewPlanMapper.insertSelective(record);
List<HyPartnerInterviewPlanDO> interviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isEmpty(interviewPlanDOS)){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_NOT_EXIST);
}
Long interviewPlanId = interviewPlanDOS.get(0).getId();
vo.setInterviewPlanId(String.valueOf(interviewPlanId));
//2.创建面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(interviewPlanId);
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
hyPartnerInterviewDO.setInterviewer(interviewrId);
hyPartnerInterviewDO.setCreateTime(new Date());
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.RESERVATION_1.getCode()));
hyPartnerInterviewDO.setDeleted(false);
hyPartnerInterviewMapper.insertSelective(hyPartnerInterviewDO);
//修改线索状态
HyPartnerLineInfoDO hyPartnerLineDO = new HyPartnerLineInfoDO();
hyPartnerLineDO.setId(request.getPartnerLineId());
hyPartnerLineDO.setWorkflowStatus(WorkflowStatusEnum.RESERVATION_1.getCode());
hyPartnerLineDO.setUpdateTime(new Date());
hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineDO);
//异步发送飞书信息给面试官
InterviewVO interviewVO = hyPartnerInterviewPlanMapper.getInterviewInfo(String.valueOf(interviewPlanId));
List<String> userIds = new ArrayList<>();
userIds.add(interviewrId);
Map<String, String> feishuUserIdsByUserIds = enterpriseUserDAO.getFeishuUserIdsByUserIds(userIds);
// SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
// sendCardMessageDTO.setUserIds(userIds);
// sendCardMessageDTO.setMessageType(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT);
// sendCardMessageDTO.setMessageUrl(linkUrl);
// sendCardMessageDTO.setTitle("面试预约申请");
// sendCardMessageDTO.setContent(generateFeiShuInterviewMsg(interviewVO.getPartnerName(), interviewVO.getPartnerMobile(), interviewVO.getStartTime()));
//替换为通过事件中心发送消息
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT,
Arrays.asList(feishuUserIdsByUserIds.get(interviewrId)),
interviewVO.getPartnerName(), interviewVO.getPartnerMobile(), interviewVO.getStartTime());
//记录日志
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
LogBasicDTO log = LogBasicDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC)).mobile(operator.getMobile()).build();
logService.recordPartnerBizLog(operator,interviewVO.getPartnerLineId(),OperateTypeEnum.INTERVIEW_APPOINTMENT,log);
return vo;
}
@Override
@Transactional
public void approveAppointment(ApproveAppointmentReq request) throws ApiException {
@@ -565,23 +486,9 @@ public class InterviewServiceImpl implements InterviewService {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
//创建日程信息
// CreateCalendarEventDTO createCalendarEventDTO = new CreateCalendarEventDTO();
// createCalendarEventDTO.setStartTime(DateUtil.parse(interviewVO.getStartTime()).getTime());
// createCalendarEventDTO.setEndTime(DateUtil.parse(interviewVO.getEndTime()).getTime());
// createCalendarEventDTO.setUserId(request.getInterviewerId());
// createCalendarEventDTO.setJoinUserIds(Arrays.asList(request.getInterviewerId()));
// createCalendarEventDTO.setSummary(generateInterviewTitle(request.getPartnerLineId()));
// UserCalendarsEventDTO userCalendarEvent = isvHttpRequest.createUserCalendarEvent(createCalendarEventDTO);
// if (userCalendarEvent == null || StringUtil.isEmpty(userCalendarEvent.getEventId())) {
// throw new ServiceException(ErrorCodeEnum.CREATE_CALENDAR_EVENT_FAIL);
// }
//更新面试计划信息
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
record.setId(Long.valueOf(request.getInterviewPlanId()));
// record.setFeishuCalendarId(userCalendarEvent.getCalendarId());
// record.setFeishuScheduleId(userCalendarEvent.getEventId());
record.setApplicationApproved(1);
//如果同意的时候已经超过预约的时间前 5 分钟,直接进入面试已开始阶段
DateTime interviewStartTime = DateUtil.offsetMinute(DateUtil.parseDateTime(interviewVO.getStartTime()), -5);
@@ -602,7 +509,6 @@ public class InterviewServiceImpl implements InterviewService {
} else {
interviewDAO.updateInterviewWorkflowStatus(request.getInterviewPlanId(), WorkflowStatusEnum.INTERVIEW_2);
}
// hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_2.getCode()));
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
@@ -610,11 +516,22 @@ public class InterviewServiceImpl implements InterviewService {
HyPartnerLineInfoDO hyPartnerLineDO = new HyPartnerLineInfoDO();
hyPartnerLineDO.setId(request.getPartnerLineId());
hyPartnerLineDO.setWorkflowStage(WorkflowStageEnum.INTERVIEW.getCode());
// hyPartnerLineDO.setWorkflowStatus(WorkflowStatusEnum.INTERVIEW_2.getCode());
hyPartnerLineDO.setUpdateTime(new Date());
hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineDO);
//异步发送短信给加盟商
eventCenterHttpRequest.sendSmsVariable(partnerBaseInfo.getMobile(), SMSMsgEnum.INTERVIEW_APPOINTMENT_PASS,DateUtil.format(DateUtil.parse(interviewVO.getStartTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN),wechatMiniAppService.getMiniAppUrl());
//记录日志
LoginUserInfo user = CurrentUserHolder.getUser();
ApproveAppointmentDTO appointmentLog = ApproveAppointmentDTO.builder()
.interviewPlanId(request.getInterviewPlanId())
.rawInterviewDateTime(DateUtil.format(DateUtil.parse(interviewVO.getStartTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN))
.operateTime(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN))
.operateUsername(user.getName())
.operateUserId(user.getUserId())
.mobile(user.getMobile())
.build();
logService.recordBizLog(user, interviewVO.getPartnerLineId(), OperateTypeEnum.INTERVIEW_APPOINTMENT_AGREEMENT, appointmentLog);
}
@Override
@@ -832,20 +749,25 @@ public class InterviewServiceImpl implements InterviewService {
if(CollectionUtils.isNotEmpty(hyPartnerInterviewPlanDOS)&&hyPartnerInterviewPlanDOS.get(0).getId()!=null){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
String interviewrId = request.getInterviewerId();
if(StringUtils.isEmpty(interviewrId)){
interviewrId = getInterviewerByPartner(request.getPartnerId(),String.valueOf(request.getPartnerLineId()));
String interviewerId = request.getInterviewerId();
if(StringUtils.isEmpty(interviewerId)){
interviewerId = getInterviewerByPartner(request.getPartnerId(),String.valueOf(request.getPartnerLineId()));
}
Date now = new Date();
//主动预约时是否是当前时间段的面试
boolean whetherBeginInterview = false;
DateTime interviewStartTime = DateUtil.offsetMinute(DateUtil.parseDateTime(request.getStartBookingTime()), -5);
if (interviewStartTime.isBeforeOrEquals(now)) {
if (interviewStartTime.isBeforeOrEquals(new Date())) {
whetherBeginInterview = true;
}
HyPartnerInterviewPlanDO interviewPlanDO = (HyPartnerInterviewPlanDO) agreeInterviewWithoutBook(request, whetherBeginInterview, interviewerId).get("interviewPlan");
return new CreateAppointmentVO(interviewPlanDO.getId().toString());
}
@Transactional
public Map<String, Object> agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId) throws ApiException {
//1.创建面试计划
HyPartnerInterviewPlanDO interviewPlanDO = new HyPartnerInterviewPlanDO();
Date now = new Date();
String startBookingTime = request.getStartBookingTime();
String startDate = startBookingTime.substring(0, 10);
interviewPlanDO.setInterviewDate(Convert.toDate(startDate));
@@ -855,7 +777,7 @@ public class InterviewServiceImpl implements InterviewService {
interviewPlanDO.setEndTime(Convert.toDate(request.getEndBookingTime()));
interviewPlanDO.setPartnerId(request.getPartnerId());
interviewPlanDO.setPartnerLineId(request.getPartnerLineId());
interviewPlanDO.setInterviewer(interviewrId);
interviewPlanDO.setInterviewer(interviewerId);
interviewPlanDO.setIsPartnerInterview(0);
interviewPlanDO.setApplicationApproved(1);
//1.2 生成房间号
@@ -879,7 +801,7 @@ public class InterviewServiceImpl implements InterviewService {
}
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
hyPartnerInterviewDO.setInterviewer(interviewrId);
hyPartnerInterviewDO.setInterviewer(interviewerId);
hyPartnerInterviewDO.setCreateTime(now);
hyPartnerInterviewDO.setUpdateTime(now);
hyPartnerInterviewDO.setDeleted(false);
@@ -907,11 +829,14 @@ public class InterviewServiceImpl implements InterviewService {
eventCenterHttpRequest.sendSmsVariable(partnerBaseInfo.getMobile(), SMSMsgEnum.INTERVIEW_APPOINTMENT_PASS, DateUtil.format(DateUtil.parseDateTime(request.getStartBookingTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN), wechatMiniAppService.getMiniAppUrl());
//5. 记录日志
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
LogBasicDTO log = LogBasicDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC)).mobile(operator.getMobile()).build();
logService.recordPartnerBizLog(operator, request.getPartnerLineId(), OperateTypeEnum.INTERVIEWER_BOOK_INTERVIEW,log);
LoginUserInfo operator = CurrentUserHolder.getUser();
LogBasicDTO log = LogBasicDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getUserId()).operateUsername(operator.getName()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC)).mobile(operator.getMobile()).build();
logService.recordBizLog(operator, request.getPartnerLineId(), OperateTypeEnum.INTERVIEWER_BOOK_INTERVIEW,log);
return new CreateAppointmentVO(interviewPlanDO.getId().toString());
HashMap<String, Object> res = new HashMap<>();
res.put("interview", hyPartnerInterviewDO);
res.put("interviewPlan", interviewPlanDO);
return res;
}
}

View File

@@ -3,35 +3,39 @@ package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.log.LogBasicDTO;
import com.cool.store.dto.log.ModifyInterviewTimeDTO;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.dto.partner.LineQueryInterviewDto;
import com.cool.store.entity.HyPartnerInterviewBookSituation;
import com.cool.store.entity.HyPartnerInterviewDO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.OperateTypeEnum;
import com.cool.store.enums.RoomStatus;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.enums.*;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.EventCenterHttpRequest;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.request.CreateAppointmentReq;
import com.cool.store.request.GetFreeBusyListReq;
import com.cool.store.request.ModifyInterviewTimeReq;
import com.cool.store.service.InterviewService;
import com.cool.store.service.LogService;
import com.cool.store.service.PartnerInterviewService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.TRTCUtils;
import com.cool.store.vo.EnterInterviewVO;
import com.cool.store.vo.PartnerInterviewInfoVO;
import com.cool.store.vo.PartnerPassLetterDetailVO;
import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.interview.CalendarInfo;
import com.cool.store.vo.interview.FreeBusyInfo;
import com.cool.store.vo.interview.CreateAppointmentVO;
import com.cool.store.vo.interview.GetFreeBusyListVO;
import com.cool.store.vo.interview.InterviewVO;
import lombok.extern.slf4j.Slf4j;
@@ -41,10 +45,11 @@ 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;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.text.MessageFormat;
import java.util.*;
@Service
@Slf4j
@@ -62,15 +67,33 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
@Autowired
private InterviewService interviewService;
@Autowired
private HyPartnerInterviewMapper hyPartnerInterviewMapper;
@Autowired
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
@Autowired
private EventCenterHttpRequest eventCenterHttpRequest;
@Autowired
private LogService logService;
@Autowired
private EnterpriseUserDAO enterpriseUserDAO;
@Autowired
private RedisUtilPool redisUtilPool;
@Value("${trtc.sdkAppId}")
private Long sdkAppId;
@Value("${trtc.secretKey}")
private String key;
@Autowired
private LogService logService;
/**
* 加盟商查询面试信息
*
@@ -222,4 +245,108 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
return interviewService.getFreeBusyList(request);
}
@Override
@Transactional
public CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException {
if(request.getPartnerLineId() == null || request.getPartnerLineId()<=0){
throw new ApiException(ErrorCodeEnum.INTERVIEW_LINE_ID_IS_NULL);
}
//如果开始时间小于当前时间需要报错
// if(DateUtil.date().isAfter(DateUtil.parse(request.getStartBookingTime()))){
// throw new ApiException(ErrorCodeEnum.CREATE_APPOINTMENT_TIME_ERROR);
// }
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewPlanDO.setDeleted(false);
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isNotEmpty(hyPartnerInterviewPlanDOS)&&hyPartnerInterviewPlanDOS.get(0).getId()!=null){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
String interviewrId = request.getInterviewerId();
if(StringUtils.isEmpty(interviewrId)){
interviewrId = interviewService.getInterviewerByPartner(request.getPartnerId(),String.valueOf(request.getPartnerLineId()));
}
CreateAppointmentVO vo = new CreateAppointmentVO();
String lockName = MessageFormat.format(RedisConstant.PARTNER_APPOINTMENT_LOCK, request.getPartnerLineId());
if (Boolean.FALSE.equals(redisUtilPool.lock(lockName, request.getPartnerLineId().toString(), 10))) {
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
//注册事务回调方法
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
redisUtilPool.unlock(lockName, request.getPartnerLineId().toString());
}
});
//1.创建面试计划
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
String startBookingTime = request.getStartBookingTime();
String startDate = startBookingTime.substring(0, 10);
record.setInterviewDate(Convert.toDate(startDate));
record.setCreateTime(new Date());
record.setUpdateTime(new Date());
record.setStartTime(Convert.toDate(request.getStartBookingTime()));
record.setEndTime(Convert.toDate(request.getEndBookingTime()));
record.setPartnerId(request.getPartnerId());
record.setPartnerLineId(request.getPartnerLineId());
record.setInterviewer(interviewrId);
record.setIsPartnerInterview(0);
//生成房间号
record.setRoomId(StringUtil.generateRoomId(startBookingTime));
record.setRoomStatus(RoomStatus.WAIT_FOR_OPEN.getCode());
record.setDeleted(false);
record.setApplicationApproved(0);
hyPartnerInterviewPlanMapper.insertSelective(record);
List<HyPartnerInterviewPlanDO> interviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isEmpty(interviewPlanDOS)){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_NOT_EXIST);
}
Long interviewPlanId = interviewPlanDOS.get(0).getId();
vo.setInterviewPlanId(String.valueOf(interviewPlanId));
//2.创建面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(interviewPlanId);
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
hyPartnerInterviewDO.setInterviewer(interviewrId);
hyPartnerInterviewDO.setCreateTime(new Date());
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.RESERVATION_1.getCode()));
hyPartnerInterviewDO.setDeleted(false);
hyPartnerInterviewMapper.insertSelective(hyPartnerInterviewDO);
//修改线索状态
HyPartnerLineInfoDO hyPartnerLineDO = new HyPartnerLineInfoDO();
hyPartnerLineDO.setId(request.getPartnerLineId());
hyPartnerLineDO.setWorkflowStatus(WorkflowStatusEnum.RESERVATION_1.getCode());
hyPartnerLineDO.setUpdateTime(new Date());
hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineDO);
//异步发送飞书信息给面试官
InterviewVO interviewVO = hyPartnerInterviewPlanMapper.getInterviewInfo(String.valueOf(interviewPlanId));
List<String> userIds = new ArrayList<>();
userIds.add(interviewrId);
Map<String, String> feishuUserIdsByUserIds = enterpriseUserDAO.getFeishuUserIdsByUserIds(userIds);
// SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
// sendCardMessageDTO.setUserIds(userIds);
// sendCardMessageDTO.setMessageType(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT);
// sendCardMessageDTO.setMessageUrl(linkUrl);
// sendCardMessageDTO.setTitle("面试预约申请");
// sendCardMessageDTO.setContent(generateFeiShuInterviewMsg(interviewVO.getPartnerName(), interviewVO.getPartnerMobile(), interviewVO.getStartTime()));
//替换为通过事件中心发送消息
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT,
Arrays.asList(feishuUserIdsByUserIds.get(interviewrId)),
interviewVO.getPartnerName(), interviewVO.getPartnerMobile(), interviewVO.getStartTime());
//记录日志
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
LogBasicDTO log = LogBasicDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC)).mobile(operator.getMobile()).build();
logService.recordPartnerBizLog(operator,interviewVO.getPartnerLineId(),OperateTypeEnum.INTERVIEW_APPOINTMENT,log);
return vo;
}
}

View File

@@ -0,0 +1,750 @@
package com.cool.store.service.impl.exhibition;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.CurrentUserHolder;
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;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.EventCenterHttpRequest;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.request.CreateAppointmentReq;
import com.cool.store.service.ExhibitionService;
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;
import com.cool.store.vo.exhibition.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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;
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;
/**
* @author Fun Li 2023/11/30 14:42
* @version 1.0
*/
@Service
@Slf4j
public class ExhibitionServiceImpl implements ExhibitionService {
@Autowired
private HyExhibitionGroupDAO hyExhibitionGroupDAO;
@Autowired
private HyExhibitionDAO hyExhibitionDAO;
@Autowired
private EventCenterHttpRequest eventCenterHttpRequest;
@Resource
EnterpriseUserDAO enterpriseUserDAO;
@Resource
HyPartnerExhibitionDAO hyPartnerExhibitionDAO;
@Resource
WechatMiniAppService wechatMiniAppService;
@Autowired
private HyPartnerInterviewMapper interviewMapper;
@Autowired
private HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
@Autowired
private InterviewService interviewService;
@Autowired
private HyPartnerInterviewPlanMapper interviewPlanMapper;
@Autowired
private TRTCUtils trtcUtils;
@Resource
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
// @Value("${offline.exhibition.channel.id}")
// private Integer offlineExhibition;
@Override
@Transactional
public EnterInterviewVO startExhibitionInterview(ExhibitionEnterInterviewDTO dto) throws ApiException {
//1. 核验线索状态
HyPartnerLineInfoDO partnerLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(Long.parseLong(dto.getPartnerLineId()));
if (ObjectUtils.isEmpty(partnerLineInfo)) {
throw new ApiException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
//1.1 获取线索参加会销状态
HyPartnerExhibitionDO hyPartnerExhibitionDO = new HyPartnerExhibitionDO();
hyPartnerExhibitionDO.setDeleted(Boolean.FALSE);
hyPartnerExhibitionDO.setExhibitionId(dto.getExhibitionId());
hyPartnerExhibitionDO.setPartnerLineId(Long.parseLong(dto.getPartnerLineId()));
hyPartnerExhibitionDO = hyPartnerExhibitionDAO.querySelective(hyPartnerExhibitionDO);
//1.2 核验会销签到状态
if (
hyPartnerExhibitionDO == null ||
//线索未会销签到并且提交意向申请或未处在预约面试阶段
!(hyPartnerExhibitionDO.getParticipationStatus().equals(ExhibitionPartnerStatus.SIGNED.getCode())))
{
throw new ApiException(ErrorCodeEnum.EXHIBITION_NOT_SIGNED);
}
//1.3 核验是否提交意向申请
if (partnerLineInfo.getWorkflowStage().equals(WorkflowStageEnum.INTENT.getCode()) && partnerLineInfo.getWorkflowStatus().equals(WorkflowStatusEnum.INTENT_0.getCode())) {
throw new ApiException(ErrorCodeEnum.EXHIBITION_NOT_SUBMIT_INTENTION);
}
//1.4 核验是否未预约面试
if (partnerLineInfo.getWorkflowStage().equals(WorkflowStageEnum.RESERVATION.getCode()) && !partnerLineInfo.getWorkflowStatus().equals(WorkflowStatusEnum.RESERVATION_0.getCode()) ||
partnerLineInfo.getWorkflowStage().equals(WorkflowStageEnum.INTERVIEW.getCode())) {
throw new ApiException(ErrorCodeEnum.EXHIBITION_LINE_INTERVIEWED);
}
//2. 调用招商经理服务的直接进入面试方法
CreateAppointmentReq createAppointmentReq = new CreateAppointmentReq();
createAppointmentReq.setPartnerId(partnerLineInfo.getPartnerId());
createAppointmentReq.setPartnerLineId(partnerLineInfo.getId());
String bookStartTime = nearestInterviewTime();
String bookEndTime = DateUtil.offsetMinute(DateUtil.parseDateTime(bookStartTime), 30).toString("yyyy-MM-dd HH:mm:ss");
createAppointmentReq.setStartBookingTime(bookStartTime);
createAppointmentReq.setEndBookingTime(bookEndTime);
Map<String, Object> interviewInfoMap = interviewService.agreeInterviewWithoutBook(createAppointmentReq, Boolean.TRUE, CurrentUserHolder.getUserId());
HyPartnerInterviewPlanDO interviewPlan = (HyPartnerInterviewPlanDO) interviewInfoMap.get("interviewPlan");
HyPartnerInterviewDO interviewInfo = (HyPartnerInterviewDO) interviewInfoMap.get("interview");
//3. 修改线索参加会销状态
HyPartnerExhibitionDO updatePartnerExhibition = new HyPartnerExhibitionDO();
updatePartnerExhibition.setId(hyPartnerExhibitionDO.getId());
updatePartnerExhibition.setParticipationStatus(ExhibitionPartnerStatus.INTERVIEWING.getCode());
hyPartnerExhibitionDAO.updateByPrimaryKeySelective(updatePartnerExhibition);
//4. 修改面试相关信息
//4.1 面试计划相关信息
HyPartnerInterviewPlanDO interviewPlanDO = new HyPartnerInterviewPlanDO();
interviewPlanDO.setId(interviewPlan.getId());
interviewPlanDO.setActualStartTime(new Date());
interviewPlanDO.setIsPartnerInterview(1);
interviewPlanMapper.updateByPrimaryKeySelective(interviewPlanDO);
//4.2 面试信息相关
HyPartnerInterviewDO interviewDO = new HyPartnerInterviewDO();
interviewDO.setId(interviewInfo.getId());
interviewDO.setPartnerEnterTime(new Date());
interviewDO.setInterviewerEnterTime(new Date());
interviewMapper.updateByPrimaryKeySelective(interviewDO);
//5. 返回进入面试间所需信息
EnterInterviewVO enterInterviewVO = interviewMapper.getInterviewerByInterviewPlanId(interviewPlan.getId().toString());
enterInterviewVO.setUserSign(trtcUtils.genUserSig(CurrentUserHolder.getUserId()));
return enterInterviewVO;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean addExhibitionGroup(ExhibitionGroupDTO exhibitionGroupDTO, LoginUserInfo userInfo) throws ApiException {
checkExhibitionGroup(exhibitionGroupDTO);
//新增会销组信息
HyExhibitionGroupDO hyExhibitionGroupDO = new HyExhibitionGroupDO();
hyExhibitionGroupDO.setExhibitionGroupName(exhibitionGroupDTO.getExhibitionGroupName());
hyExhibitionGroupDO.setCreator(userInfo.getUserId());
hyExhibitionGroupDAO.insertSelective(hyExhibitionGroupDO);
//新增会销信息
List<HyExhibitionDO> insertList = new ArrayList<>();
for (ExhibitionDTO exhibitionDTO : exhibitionGroupDTO.getExhibitionList()){
HyExhibitionDO hyExhibitionDO = new HyExhibitionDO();
hyExhibitionDO.setExhibitionName(exhibitionDTO.getExhibitionName());
if (CollectionUtils.isNotEmpty(exhibitionDTO.getCollaborators())){
String collaborators = exhibitionDTO.getCollaborators().stream().map(CollaboratorDTO::getCollaborateId).collect(Collectors.joining(Constants.COMMA));
hyExhibitionDO.setCollaborators(String.format("%s%s%s", Constants.COMMA, collaborators, Constants.COMMA));
}
hyExhibitionDO.setExhibitionCode(String.valueOf(CommonConstants.MIN_CODE+new Random().nextInt(CommonConstants.MAX_CODE)));
hyExhibitionDO.setCreator(userInfo.getUserId());
hyExhibitionDO.setLocation(exhibitionDTO.getLocation());
hyExhibitionDO.setExhibitionGroupId(hyExhibitionGroupDO.getId());
hyExhibitionDO.setStartDate(CoolDateUtils.parseDate(exhibitionDTO.getStartDate(),CoolDateUtils.DATE_FORMAT_SEC_2));
insertList.add(hyExhibitionDO);
}
//批量新增会销
batchInsertExhibition(exhibitionGroupDTO,insertList,userInfo);
return Boolean.TRUE;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean editExhibitionGroup(ExhibitionGroupDTO exhibitionGroupDTO, LoginUserInfo userInfo) throws ApiException {
checkExhibitionGroup(exhibitionGroupDTO);
//编辑 ID不能为空
if (exhibitionGroupDTO.getExhibitionGroupId() == null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
HyExhibitionGroupDO hyExhibitionGroupDO = hyExhibitionGroupDAO.selectByPrimaryKey(exhibitionGroupDTO.getExhibitionGroupId());
//会销组不存在
if (hyExhibitionGroupDO== null){
throw new ServiceException(ErrorCodeEnum.EXHIBITION_GROUP_NOT_EXIST);
}
// TODO: 2023/12/4 关闭的会销组是否能修改?
hyExhibitionGroupDO.setExhibitionGroupName(exhibitionGroupDTO.getExhibitionGroupName());
hyExhibitionGroupDO.setUpdater(userInfo.getUserId());
hyExhibitionGroupDAO.updateByPrimaryKeySelective(hyExhibitionGroupDO);
List<HyExhibitionDO> batchInsertList = new ArrayList<>();
List<HyExhibitionDO> batchUpdateList = new ArrayList<>();
exhibitionGroupDTO.getExhibitionList().forEach(exhibitionDTO->{
HyExhibitionDO hyExhibitionDO = new HyExhibitionDO();
hyExhibitionDO.setExhibitionGroupId(hyExhibitionGroupDO.getId());
hyExhibitionDO.setExhibitionName(exhibitionDTO.getExhibitionName());
hyExhibitionDO.setLocation(exhibitionDTO.getLocation());
if (CollectionUtils.isNotEmpty(exhibitionDTO.getCollaborators())){
String collaborators = exhibitionDTO.getCollaborators().stream().map(CollaboratorDTO::getCollaborateId).collect(Collectors.joining(Constants.COMMA));
hyExhibitionDO.setCollaborators(String.format("%s%s%s", Constants.COMMA, collaborators, Constants.COMMA));
}
if (exhibitionDTO.getId()== null){
hyExhibitionDO.setCreator(userInfo.getUserId());
hyExhibitionDO.setExhibitionCode(String.valueOf(CommonConstants.MIN_CODE+new Random().nextInt(CommonConstants.MAX_CODE)));
hyExhibitionDO.setStartDate(CoolDateUtils.parseDate(exhibitionDTO.getStartDate(),CoolDateUtils.DATE_FORMAT_DAY_2));
batchInsertList.add(hyExhibitionDO);
}else {
hyExhibitionDO.setUpdater(userInfo.getUserId());
hyExhibitionDO.setId(exhibitionDTO.getId());
if (CollectionUtils.isEmpty(exhibitionDTO.getCollaborators())){
hyExhibitionDO.setCollaborators("");
}
batchUpdateList.add(hyExhibitionDO);
}
});
//batchInsertList 不为空 批量新增
if (CollectionUtils.isNotEmpty(batchInsertList)){
batchInsertExhibition(exhibitionGroupDTO,batchInsertList,userInfo);
}
//batchUpdateList 不为空 批量更新
if (CollectionUtils.isNotEmpty(batchUpdateList)){
hyExhibitionDAO.batchUpdate(batchUpdateList);
}
return Boolean.TRUE;
}
@Override
public PageInfo<MyExhibitionVO> getMyExhibitionList(String userId,String startDate,String closedType,Integer pageSize,Integer pageNum) {
Integer type = CommonConstants.MINUS_ONE;
if (StringUtils.isNotEmpty(closedType)){
type = CommonConstants.CLOSE.equals(closedType)?CommonConstants.ONE:CommonConstants.ZERO;
}
PageHelper.startPage(pageNum,pageSize);
List<HyExhibitionDO> exhibitionList = hyExhibitionDAO.getExhibitionListByUserId(userId, startDate, type);
PageInfo hyExhibitionDOPage = new PageInfo<>(exhibitionList);
if (CollectionUtils.isEmpty(exhibitionList)){
return hyExhibitionDOPage;
}
List<MyExhibitionVO> list = new ArrayList<>();
//查询协作人
Set<String> collaboratorsSet = new HashSet();
List<String> codeList = new ArrayList<>();
exhibitionList.forEach(x->{
codeList.add(x.getExhibitionCode());
if (StringUtils.isNotEmpty(x.getCollaborators())){
List<String> userIdList = Arrays.asList(x.getCollaborators().substring(1).split(Constants.COMMA));
collaboratorsSet.addAll(userIdList);
}
});
List<EnterpriseUserDO> userInfoList = enterpriseUserDAO.getUserInfoByUserIds(new ArrayList<>(collaboratorsSet));
Map<String, CollaboratorVO> resultMap = userInfoList.stream()
.collect(Collectors.toMap(EnterpriseUserDO::getUserId,
u -> new CollaboratorVO(u.getUserId(), u.getName())));
Map<String, ExhibitionStatisticsDTO> StatisticsMap = hyExhibitionDAO.exhibitionStatisticsMap(codeList);
exhibitionList.forEach(x->{
MyExhibitionVO myExhibitionVO = new MyExhibitionVO();
myExhibitionVO.setExhibitionName(x.getExhibitionName());
myExhibitionVO.setLocation(x.getLocation());
myExhibitionVO.setId(x.getId());
myExhibitionVO.setClosedType(x.getClosedType());
myExhibitionVO.setStartDate(DateUtils.format(x.getStartDate(),DateUtils.DATE_FORMAT_10));
if (StringUtils.isNotEmpty(x.getCollaborators())){
List<String> userIdList = Arrays.asList(x.getCollaborators().substring(1).split(Constants.COMMA));
List<CollaboratorVO> coll = new ArrayList<>();
userIdList.forEach(userIds->{
coll.add(resultMap.get(userIds));
});
myExhibitionVO.setCollaborators(coll);
}
ExhibitionStatisticsDTO statistics = StatisticsMap.getOrDefault(x.getExhibitionCode(), new ExhibitionStatisticsDTO());
myExhibitionVO.setSignUpCount(statistics.getSignUpCount());
myExhibitionVO.setCheckInCount(statistics.getCheckInCount());
myExhibitionVO.setFormFillCount(statistics.getFormFillCount());
myExhibitionVO.setInterviewCount(statistics.getInterviewCount());
list.add(myExhibitionVO);
});
hyExhibitionDOPage.setList(list);
return hyExhibitionDOPage;
}
@Override
public PageInfo<MyExhibitionGroupVO> getMyExhibitionGroupList(String userId, Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize);
List<MyExhibitionGroupDTO> myExhibitionGroupDTOS = hyExhibitionGroupDAO.listByCreator(userId);
PageInfo myExhibitionGroupDTOPage = new PageInfo<>(myExhibitionGroupDTOS);
if (CollectionUtils.isEmpty(myExhibitionGroupDTOS)){
return myExhibitionGroupDTOPage;
}
List<Integer> groupIds = myExhibitionGroupDTOS.stream().map(MyExhibitionGroupDTO::getId).collect(Collectors.toList());
List<ExhibitionDTO> exhibitionDTOS = hyExhibitionDAO.listByExhibitionGroupIds(groupIds);
Map<Integer, List<ExhibitionDTO>> groupMap = exhibitionDTOS.stream().collect(Collectors.groupingBy(ExhibitionDTO::getExhibitionGroupId));
List<MyExhibitionGroupVO> result = new ArrayList<>();
myExhibitionGroupDTOS.forEach(x->{
MyExhibitionGroupVO myExhibitionGroupVO = new MyExhibitionGroupVO();
myExhibitionGroupVO.setExhibitionGroupName(x.getExhibitionGroupName());
myExhibitionGroupVO.setId(x.getId());
myExhibitionGroupVO.setClosed(x.getClosed());
myExhibitionGroupVO.setCreateId(x.getCreateId());
myExhibitionGroupVO.setCreateName(x.getCreateName());
myExhibitionGroupVO.setMobile(x.getMobile());
List<ExhibitionDTO> list = groupMap.get(x.getId());
List<ExhibitionVO> exhibitionVOS = new ArrayList<>();
Date date = null;
if (CollectionUtils.isNotEmpty(list)){
//根据ID排序
list.sort(Comparator.comparing(ExhibitionDTO::getId));
list.forEach(exhibitionDTO->{
ExhibitionVO exhibitionVO = new ExhibitionVO();
exhibitionVO.setExhibitionName(exhibitionDTO.getExhibitionName());
exhibitionVO.setStartDate(exhibitionDTO.getStartDate());
exhibitionVO.setId(exhibitionDTO.getId());
exhibitionVOS.add(exhibitionVO);
});
//是否所有的不为空 所有不为空表示 会销组结束
Boolean flag = list.stream().map(ExhibitionDTO::getCloseTime).allMatch(closeTime -> closeTime != null);
if(flag){
date = list.stream().map(ExhibitionDTO::getCloseTime).filter(closeTime -> closeTime != null).max(Date::compareTo).orElse(null);
}
}
myExhibitionGroupVO.setExhibitionList(exhibitionVOS);
if (date!=null){
myExhibitionGroupVO.setExpiresTime(DateUtils.format(date, DateUtils.DATE_FORMAT_19_FORWARD_SLASH));
}
result.add(myExhibitionGroupVO);
});
myExhibitionGroupDTOPage.setList(result);
return myExhibitionGroupDTOPage;
}
@Override
public ExhibitionGroupDetailVO getExhibitionGroupDetail(Integer exhibitionGroupId) {
//查询标签组
HyExhibitionGroupDO hyExhibitionGroupDO = hyExhibitionGroupDAO.selectByPrimaryKey(exhibitionGroupId);
if (ObjectUtils.isEmpty(hyExhibitionGroupDO)){
throw new ServiceException(ErrorCodeEnum.EXHIBITION_GROUP_NOT_EXIST);
}
ExhibitionGroupDetailVO exhibitionGroupDetailVO = new ExhibitionGroupDetailVO();
exhibitionGroupDetailVO.setExhibitionGroupName(hyExhibitionGroupDO.getExhibitionGroupName());
exhibitionGroupDetailVO.setId(hyExhibitionGroupDO.getId());
List<ExhibitionDTO> exhibitionDTOS = hyExhibitionDAO.listByExhibitionGroupIds(Arrays.asList(exhibitionGroupId));
List<ExhibitionVO> exhibitionVOS = new ArrayList<>();
//会销对应的会销协作人map
Map<String, CollaboratorVO> resultMap = getExhibitionCollaboratorMap(exhibitionDTOS);
exhibitionDTOS.forEach(exhibitionDTO->{
ExhibitionVO exhibitionVO = new ExhibitionVO();
exhibitionVO.setExhibitionName(exhibitionDTO.getExhibitionName());
exhibitionVO.setStartDate(exhibitionDTO.getStartDate());
exhibitionVO.setLocation(exhibitionDTO.getLocation());
exhibitionVO.setId(exhibitionDTO.getId());
if (StringUtils.isNotEmpty(exhibitionDTO.getCollaboratorStr())){
List<String> userIdList = Arrays.asList(exhibitionDTO.getCollaboratorStr().substring(1).split(Constants.COMMA));
List<CollaboratorVO> coll = new ArrayList<>();
userIdList.forEach(userIds->{
coll.add(resultMap.get(userIds));
});
exhibitionVO.setCollaborators(coll);
}
exhibitionVOS.add(exhibitionVO);
});
exhibitionGroupDetailVO.setExhibitionList(exhibitionVOS);
return exhibitionGroupDetailVO;
}
@Override
public ExhibitionDetailVO getExhibitionDetail(Integer exhibitionId) {
HyExhibitionDO hyExhibitionDO = hyExhibitionDAO.selectByPrimaryKey(exhibitionId);
if (hyExhibitionDO==null){
throw new ServiceException(ErrorCodeEnum.EXHIBITION_NOT_EXIST);
}
ExhibitionDetailVO exhibitionDetailVO = new ExhibitionDetailVO();
exhibitionDetailVO.setExhibitionName(hyExhibitionDO.getExhibitionName());
exhibitionDetailVO.setId(hyExhibitionDO.getId());
exhibitionDetailVO.setLocation(hyExhibitionDO.getLocation());
exhibitionDetailVO.setStartDate(DateUtil.format(hyExhibitionDO.getStartDate(), CoolDateUtils.DATE_FORMAT_DAY_2));
exhibitionDetailVO.setClosedType(hyExhibitionDO.getClosedType());
exhibitionDetailVO.setCreateTime(DateUtil.format(hyExhibitionDO.getCreateTime(), CoolDateUtils.DATE_FORMAT_SEC_7));
exhibitionDetailVO.setCloseTime(DateUtil.format(hyExhibitionDO.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC_7));
if (StringUtils.isNotEmpty(hyExhibitionDO.getCollaborators())) {
List<String> userIdList = Arrays.asList(hyExhibitionDO.getCollaborators().substring(1).split(Constants.COMMA));
List<EnterpriseUserDO> userInfoList = enterpriseUserDAO.getUserInfoByUserIds(userIdList);
List<CollaboratorVO> collaboratorVOS = userInfoList.stream().map(u -> new CollaboratorVO(u.getUserId(), u.getName())).collect(Collectors.toList());
exhibitionDetailVO.setCollaborators(collaboratorVOS);
}
if (StringUtils.isNotEmpty(hyExhibitionDO.getCreator())){
EnterpriseUserDO user = enterpriseUserDAO.getUserInfoById(hyExhibitionDO.getCreator());
exhibitionDetailVO.setCreateId(user.getUserId());
exhibitionDetailVO.setMobile(user.getMobile());
exhibitionDetailVO.setCreateName(user.getName());
}
return exhibitionDetailVO;
}
@Override
public Boolean editExhibition(ExhibitionDTO exhibitionDTO, LoginUserInfo userInfo) {
if (exhibitionDTO == null || exhibitionDTO.getId()==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
//查询会销
HyExhibitionDO hyExhibitionDO = hyExhibitionDAO.selectByPrimaryKey(exhibitionDTO.getId());
if (hyExhibitionDO == null){
throw new ServiceException(ErrorCodeEnum.EXHIBITION_NOT_EXIST);
}
hyExhibitionDO.setExhibitionName(exhibitionDTO.getExhibitionName());
hyExhibitionDO.setLocation(exhibitionDTO.getLocation());
if (CollectionUtils.isNotEmpty(exhibitionDTO.getCollaborators())){
String collaborators = exhibitionDTO.getCollaborators().stream().map(CollaboratorDTO::getCollaborateId).collect(Collectors.joining(Constants.COMMA));
hyExhibitionDO.setCollaborators(String.format("%s%s%s", Constants.COMMA, collaborators, Constants.COMMA));
}else {
//如果协助人没有 则需要置空
hyExhibitionDO.setCollaborators("");
}
hyExhibitionDO.setUpdater(userInfo.getName());
hyExhibitionDAO.updateByPrimaryKeySelective(hyExhibitionDO);
//发送通知 给报名的人员
//查询报名了该会销的线索
List<ExhibitionLineDTO> exhibitionLine = hyPartnerExhibitionDAO.getExhibitionLine(hyExhibitionDO.getId());
exhibitionLine.forEach(x->{
try {
eventCenterHttpRequest.sendSmsVariable(x.getMobile(), SMSMsgEnum.EXHIBITION_INFO_UPDATE,hyExhibitionDO.getExhibitionName(),
DateUtils.format(hyExhibitionDO.getStartDate(),CoolDateUtils.DATE_FORMAT_DAY_2),hyExhibitionDO.getLocation(),wechatMiniAppService.getMiniAppUrl());
} catch (ApiException e) {
log.info("发送短信通知失败,mobile:{},ex:{}",x.getMobile(),e);
}
});
return Boolean.TRUE;
}
@Override
public PageInfo<ExhibitionLineVO> getExhibitionLineList(Integer exhibitionId, Integer participationStatus, String partnerUserId, Integer pageSize, Integer pageNum,String userId) {
if (exhibitionId==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
PageHelper.startPage(pageNum, pageSize);
List<ExhibitionLineDTO> exhibitionLineDTOS = hyPartnerExhibitionDAO.exhibitionLineList(exhibitionId, participationStatus, partnerUserId,userId);
PageInfo pageInfo = new PageInfo<>(exhibitionLineDTOS);
if (CollectionUtils.isEmpty(exhibitionLineDTOS)){
return pageInfo;
}
List<Integer> lineIds = exhibitionLineDTOS.stream().map(ExhibitionLineDTO::getLineId).collect(Collectors.toList());
//面试官info
List<LineInterviewDTO> lineInterviewList = hyPartnerLineInfoDAO.lineInterviewList(lineIds);
Map<Integer, LineInterviewDTO> lineInterviewMap = lineInterviewList.stream().collect(Collectors.toMap(LineInterviewDTO::getLineId, date -> date));
//招商经理info
List<LineInterviewDTO> lineInvestmentList = hyPartnerLineInfoDAO.lineInvestmentList(lineIds);
Map<Integer, LineInterviewDTO> lineInvestmentMap = lineInvestmentList.stream().collect(Collectors.toMap(LineInterviewDTO::getLineId, date -> date));
List<ExhibitionLineVO> result = new ArrayList<>();
exhibitionLineDTOS.forEach(x->{
ExhibitionLineVO exhibitionLineVO = new ExhibitionLineVO();
LineInterviewDTO inter = lineInterviewMap.getOrDefault(x.getLineId(), new LineInterviewDTO());
LineInterviewDTO investment = lineInvestmentMap.getOrDefault(x.getLineId(), new LineInterviewDTO());
BeanUtil.copyProperties(x,exhibitionLineVO);
exhibitionLineVO.setInvestmentManager(investment.getInvestmentManager());
exhibitionLineVO.setInvestmentManagerName(investment.getInvestmentManagerName());
exhibitionLineVO.setInvestmentManagerMobile(investment.getInvestmentManagerMobile());
exhibitionLineVO.setInterviewer(inter.getInterviewer());
exhibitionLineVO.setInterviewerName(inter.getInterviewerName());
exhibitionLineVO.setInterviewerMobile(inter.getInterviewerMobile());
result.add(exhibitionLineVO);
});
pageInfo.setList(result);
return pageInfo;
}
@Override
public List<ExhibitionLineBaseVO> exhibitionLineBaseList(Integer exhibitionId, String partnerName) {
List<ExhibitionLineBaseDTO> exhibitionLineBaseDTOS = hyPartnerExhibitionDAO.exhibitionLineBaseInfo(partnerName, exhibitionId);
List<ExhibitionLineBaseVO> result = new ArrayList<>();
exhibitionLineBaseDTOS.forEach(x->{
ExhibitionLineBaseVO exhibitionLineBaseVO = new ExhibitionLineBaseVO();
BeanUtil.copyProperties(x,exhibitionLineBaseVO);
result.add(exhibitionLineBaseVO);
});
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;
}
/**
* 协作人处理
* @param exhibitionList
* @return
*/
private Map<String, CollaboratorVO> getExhibitionCollaboratorMap(List<ExhibitionDTO> exhibitionList){
Set<String> collaboratorsSet = new HashSet();
Map<String, CollaboratorVO> resultMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(exhibitionList)) {
exhibitionList.forEach(x -> {
if (StringUtils.isNotEmpty(x.getCollaboratorStr())) {
List<String> userIdList = Arrays.asList(x.getCollaboratorStr().substring(1).split(Constants.COMMA));
collaboratorsSet.addAll(userIdList);
}
});
List<EnterpriseUserDO> userInfoList = enterpriseUserDAO.getUserInfoByUserIds(new ArrayList<>(collaboratorsSet));
resultMap = userInfoList.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId,
u -> new CollaboratorVO(u.getUserId(), u.getName())));
}
return resultMap;
}
/**
* 新增数据
* @param insertList
*/
private void batchInsertExhibition(ExhibitionGroupDTO exhibitionGroupDTO,List<HyExhibitionDO> insertList,LoginUserInfo userInfo) throws ApiException {
hyExhibitionDAO.batchInsert(insertList);
//新增之后 发送消息通知 防止通知已发送 数据出现回滚
for (ExhibitionDTO exhibitionDTO : exhibitionGroupDTO.getExhibitionList()){
//更新不需要 发送工作通知
if (exhibitionDTO.getId()!=null){
continue;
}
if (CollectionUtils.isNotEmpty(exhibitionDTO.getCollaborators())){
List<String> userIds = exhibitionDTO.getCollaborators().stream().map(CollaboratorDTO::getCollaborateId).collect(Collectors.toList());
List<String> userIdsByUserIds = enterpriseUserDAO.getFeishuUserIdListByUserIds(userIds);
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.EXHIBITION_COLLABORATOR, userIdsByUserIds,userInfo.getName(),
exhibitionDTO.getExhibitionName(),exhibitionDTO.getStartDate(),exhibitionDTO.getLocation());
}
}
}
/**
* 校验一下会销组
* @param exhibitionGroupDTO
*/
private void checkExhibitionGroup(ExhibitionGroupDTO exhibitionGroupDTO) {
if (exhibitionGroupDTO == null|| StringUtils.isEmpty(exhibitionGroupDTO.getExhibitionGroupName())){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
//会销组中必须添加至少一个会销
if (CollectionUtils.isEmpty(exhibitionGroupDTO.getExhibitionList())){
throw new ServiceException(ErrorCodeEnum.EXHIBITION_GROUP_NOT_NULL);
}
}
/**
* 返回时间
* @return YYYY-MM-DD HH:mm:ss
*/
private String nearestInterviewTime() {
LocalDateTime now = LocalDateTime.now();
int minute = now.getMinute();
LocalDateTime nearestDateTime;
//1. 在 00-30 范围内,最近的面试开始时间为 00
if (minute < 30) {
nearestDateTime = now.withMinute(0).withSecond(0).withNano(0);
//2. 在 30-00 范围内,最近的面试开始时间为 30
} else {
nearestDateTime = now.withMinute(30).withSecond(0).withNano(0);
}
// 格式化为字符串
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return nearestDateTime.format(formatter);
}
}

View File

@@ -3,12 +3,10 @@ package com.cool.store.service.impl.workflow;
import cn.hutool.core.date.DateUtil;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
import com.cool.store.dto.log.ReInterviewDTO;
import com.cool.store.dao.HyPartnerExhibitionDAO;
import com.cool.store.dto.log.RejectInterviewDTO;
import com.cool.store.entity.HyInspectionDO;
import com.cool.store.entity.HyPartnerExhibitionDO;
import com.cool.store.entity.HyPartnerInterviewDO;
import com.cool.store.enums.*;
import com.cool.store.exception.ApiException;
@@ -65,6 +63,10 @@ public class InterviewWorkFlowService extends WorkFlowBaseService {
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
@Autowired
private HyPartnerExhibitionDAO partnerExhibitionDAO;
@Override
public WorkflowStageEnum getWorkFlowStage() {
return WorkflowStageEnum.RESERVATION;
@@ -107,6 +109,8 @@ public class InterviewWorkFlowService extends WorkFlowBaseService {
inspectionMapper.updateByPrimaryKeySelective(hyInspection);
}
interviewService.rejectInterviewAndSuspendLine(interviewBaseInfo.getId(),interviewBaseInfo.getInterviewPlanId(),null);
//将线索进行到面试中的会销信息设为不通过
partnerExhibitionDAO.rejectExhibitionInterview(interviewBaseInfo.getPartnerLineId().toString());
//记录日志
RejectInterviewDTO log = RejectInterviewDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getUserId()).operateUsername(operator.getName()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
.rejectRealReason(request.getRejectRealReason()).rejectPublicReason(request.getRejectPublicReason()).certifyFile(request.getCertifyFile()).build();

View File

@@ -25,7 +25,7 @@ import java.util.List;
* @description:
* @date 2023/05/15 02:52
*/
@Profile({"local", "dev", "ab", "test"})
@Profile({"local", "dev", "ab", "test", "pre"})
@Configuration
@EnableSwagger2
@EnableKnife4j

View File

@@ -0,0 +1,126 @@
package com.cool.store.controller;
import com.cool.store.context.CurrentUserHolder;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author Fun Li 2023/11/30 14:44
* @version 1.0
*/
@RestController
@Api(tags = "会销相关接口")
@RequestMapping("/exhibition")
@Slf4j
public class ExhibitionController {
@Autowired
private ExhibitionService exhibitionService;
@PostMapping(value = "/addExhibitionGroup")
@ApiOperation("添加会销组")
public ResponseResult addExhibitionGroup(@RequestBody ExhibitionGroupDTO exhibitionGroupDTO) throws ApiException {
return ResponseResult.success(exhibitionService.addExhibitionGroup(exhibitionGroupDTO, CurrentUserHolder.getUser()));
}
@PostMapping(value = "/editExhibitionGroup")
@ApiOperation("编辑会销组")
public ResponseResult editExhibitionGroup(@RequestBody ExhibitionGroupDTO exhibitionGroupDTO) throws ApiException {
return ResponseResult.success(exhibitionService.editExhibitionGroup(exhibitionGroupDTO, CurrentUserHolder.getUser()));
}
@GetMapping(value = "/getMyExhibitionList")
@ApiOperation("我的会销")
public ResponseResult getMyExhibitionList(@RequestParam(required = false,value = "closedTye") String closedTye,
@RequestParam(required = false,value = "startDate") String startDate,
@RequestParam(required = false,value = "pageNum") Integer pageNum,
@RequestParam(required = false,value = "pageSize") Integer pageSize) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(exhibitionService.getMyExhibitionList(user.getUserId(),closedTye,startDate,pageSize,pageNum));
}
@GetMapping(value = "/getMyExhibitionGroupList")
@ApiOperation("我的会销组")
public ResponseResult getMyExhibitionGroupList(@RequestParam(required = false,value = "pageNum") Integer pageNum,
@RequestParam(required = false,value = "pageSize") Integer pageSize) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(exhibitionService.getMyExhibitionGroupList(user.getUserId(),pageSize,pageNum));
}
@GetMapping(value = "/getExhibitionGroupDetail")
@ApiOperation("会销组详情")
public ResponseResult getExhibitionGroupDetail(@RequestParam(required = false,value = "exhibitionGroupId") Integer exhibitionGroupId) {
return ResponseResult.success(exhibitionService.getExhibitionGroupDetail(exhibitionGroupId));
}
@GetMapping(value = "/exhibitionDetail")
@ApiOperation("会销详情")
public ResponseResult getExhibitionDetail(@RequestParam(required = false,value = "exhibitionId") Integer exhibitionId) {
return ResponseResult.success(exhibitionService.getExhibitionDetail(exhibitionId));
}
@PostMapping(value = "/editExhibition")
@ApiOperation("编辑会销")
public ResponseResult editExhibition(@RequestBody ExhibitionDTO exhibitionDTO) {
return ResponseResult.success(exhibitionService.editExhibition(exhibitionDTO, CurrentUserHolder.getUser()));
}
@ApiOperation("会销面试")
@PostMapping("/enter/interview")
public ResponseResult<EnterInterviewVO> enterInterview(@RequestBody ExhibitionEnterInterviewDTO dto) throws ApiException {
return ResponseResult.success(exhibitionService.startExhibitionInterview(dto));
}
@GetMapping(value = "/getExhibitionLineList")
@ApiOperation("会销报名列表")
public ResponseResult getExhibitionLineList(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId,
@RequestParam(required = false,value = "participationStatus") Integer participationStatus,
@RequestParam(required = false,value = "partnerId") String partnerId,
@RequestParam(required = false,value = "PageSize" ,defaultValue = "10") Integer PageSize,
@RequestParam(required = false,value = "pageNum",defaultValue = "1") Integer pageNum) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(exhibitionService.getExhibitionLineList(exhibitionId,participationStatus,partnerId,PageSize,pageNum,user.getUserId()));
}
@GetMapping(value = "/getExhibitionSignUpList")
@ApiOperation("会销报名列表")
public ResponseResult getExhibitionLineList(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId,
@RequestParam(required = false,value = "partnerName") String partnerName) {
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));
}
}

View File

@@ -0,0 +1,30 @@
package com.cool.store.service;
import com.cool.store.exception.ApiException;
import com.cool.store.request.GetTipsInfoReq;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
/**
* @author Fun Li 2023/12/4 14:51
* @version 1.0
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
class CommonServiceImplTest extends AbstractJUnit4SpringContextTests {
@Autowired
private CommonService commonService;
@Test
void testGetTipsInfo() throws ApiException {
GetTipsInfoReq getTipsInfoReq = new GetTipsInfoReq();
getTipsInfoReq.setPartnerLineId("237272");
String tipsInfo = commonService.getTipsInfo(getTipsInfoReq);
log.debug(tipsInfo);
}
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.service;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
/**
* @author Fun Li 2023/12/6 16:17
* @version 1.0
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
class ExhibitionServiceTest extends AbstractJUnit4SpringContextTests {
@Autowired
private ExhibitionService exhibitionService;
@Test
void testStartExhibitionInterview() {
log.debug("");
}
}

View File

@@ -0,0 +1,71 @@
package com.cool.store.service;
import cn.hutool.core.date.DateUtil;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.log.AutoOpenInterviewRoomDTO;
import com.cool.store.enums.OperateTypeEnum;
import com.cool.store.enums.RoomStatus;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.request.GetTipsInfoReq;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import java.util.Arrays;
import java.util.List;
/**
* @author Fun Li 2023/12/12 18:07
* @version 1.0
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
class HyPartnerInterviewTest extends AbstractJUnit4SpringContextTests {
@Autowired
private HyPartnerInterviewPlanService hyPartnerInterviewPlanService;
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
@Autowired
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
@Autowired
private HyInterviewDAO interviewDAO;
@Autowired
private LogService logService;
@Autowired
private CommonService commonService;
@Test
void testOpenInterviewRoom() throws ApiException {
//更新房间状态为开启
List<Long> lineIds = Arrays.asList(38711L);
hyPartnerInterviewPlanMapper.openInterviewRoom(lineIds, RoomStatus.OPEN.getCode());
interviewDAO.batchUpdateInterviewWorkflowStatus(lineIds,Integer.parseInt(WorkflowStatusEnum.INTERVIEW_3.getCode()));
//记录日志
LoginUserInfo user = CurrentUserHolder.getUser();
AutoOpenInterviewRoomDTO autoOpenInterviewRoomLog = AutoOpenInterviewRoomDTO.builder()
.operateTime(DateUtil.now()).build();
for (Long lineId : lineIds) {
logService.recordBizLog(user, lineId, OperateTypeEnum.AUTO_OPEN_INTERVIEW, autoOpenInterviewRoomLog);
}
GetTipsInfoReq getTipsInfoReq = new GetTipsInfoReq();
getTipsInfoReq.setPartnerLineId(lineIds.get(0).toString());
String tipsInfo = commonService.getTipsInfo(getTipsInfoReq);
log.info("tipsInfo:{}", tipsInfo);
}
}

View File

@@ -27,7 +27,7 @@ import java.util.List;
* @description:
* @date 2023/05/15 02:52
*/
@Profile({"local", "dev", "ab", "test"})
@Profile({"local", "dev", "ab", "test", "pre"})
@Configuration
@EnableSwagger2
@EnableKnife4j

View File

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

View File

@@ -3,7 +3,6 @@ package com.cool.store.controller;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.dto.partner.LineQueryInterviewDto;
import com.cool.store.dto.partner.PartnerGetPassLetterDetailDto;
import com.cool.store.dto.partner.PartnerQueryInterviewDto;
import com.cool.store.exception.ApiException;
import com.cool.store.request.CreateAppointmentReq;
import com.cool.store.request.GetFreeBusyListReq;
@@ -68,7 +67,7 @@ public class InterviewController {
@PostMapping("/appointment/submit")
@ApiOperation("预约面试")
public ResponseResult<CreateAppointmentVO> createAppointment(@RequestBody CreateAppointmentReq request) throws ApiException {
return ResponseResult.success(interviewBaseService.createAppointment(request));
return ResponseResult.success(interviewService.createAppointment(request));
}
@PostMapping("/modifyInterviewTime")