招商阶段钉钉消息通知

This commit is contained in:
guohb
2024-05-20 15:31:24 +08:00
parent 992bcc6551
commit 3bece16f34
5 changed files with 75 additions and 12 deletions

View File

@@ -16,6 +16,7 @@ import com.cool.store.service.IntentAgreementService;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.SecureUtil;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -25,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -73,12 +75,6 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Transactional(rollbackFor = Exception.class)
public boolean submit(IntentAgreementSubmitRequest request) {
SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO();
// if (Objects.nonNull(request.getIdCardNo()) || Objects.nonNull(request.getBusinessLicenseCode())) {
// SigningBaseInfoDO isExist = intentAgreementMapper.judge(request);
// if (Objects.nonNull(isExist)) {
// throw new ServiceException(ErrorCodeEnum.BUSINESS_LICENSE_OR_ID_CARD_REPEAT);
// }
// }
boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO);
if (submitStatus) {
LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId());
@@ -87,6 +83,14 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
}
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("partnerUsername",lineInfoDO.getUsername());
requestMap.put("partnerMobile",lineInfoDO.getMobile());
requestMap.put("lineId",String.valueOf(lineInfoDO.getId()));
requestMap.put("submitTime", DateUtils.dateTimeNow(DateUtils.SPECIAL_DATE_START));
commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()),
MessageEnum.MESSAGE_30,
requestMap);
return Boolean.TRUE;
}
@@ -162,6 +166,14 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_80.getCode());
lineInfo.setUpdateUserId(userId);
lineInfoDAO.updateLineInfo(lineInfo);
//message
Map<String, String> requestMap = new HashMap<>();
requestMap.put("partnerUsername",lineInfo.getUsername());
requestMap.put("lineId",String.valueOf(lineInfo.getId()));
requestMap.put("submitTime", DateUtils.dateTimeNow(DateUtils.SPECIAL_DATE_START));
commonService.sendMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
MessageEnum.MESSAGE_31,
requestMap);
}
//更新auditId
intentAgreementMapper.updateAuditId(lineInfo.getId(), auditId);

View File

@@ -20,6 +20,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -49,6 +52,9 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
@Resource
LineInfoMapper lineInfoMapper;
@Resource
CommonService commonService;
@Override
@Transactional(rollbackFor = Exception.class)
public boolean submit(JoinIntentionRequest request) {
@@ -76,6 +82,16 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
memberQuestionDO.setLineId(lineInfoParam.getId());
joinIntentionMapper.insertOrUpdate(memberQuestionDO);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("partnerUsername",lineInfoParam.getUsername());
requestMap.put("partnerMobile",lineInfoParam.getMobile());
requestMap.put("lineId",String.valueOf(lineInfoParam.getId()));
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoParam.getWantShopAreaId());
requestMap.put("regionName",openAreaInfoDO.getAreaName());
commonService.sendMessage(Collections.singletonList(lineInfoParam.getInvestmentManager()),
MessageEnum.MESSAGE_29,
requestMap);
return Boolean.TRUE;
}

View File

@@ -145,6 +145,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(shopInfoDO.getLineId());
log.info("submitSignFranchise franchiseAgreementRequest :{}",JSONObject.toJSONString(franchiseAgreementRequest));
ResponseResult responseResult = coolStoreStartFlowService.franchiseAgreement(franchiseAgreementRequest, memberQuestionDO.getJoinType());
//更新状态为加盟商
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
lineInfoDO.setJoinStatus(2);
lineInfoMapper.insertOrUpdate(lineInfoDO);
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83);
return responseResult;
}

View File

@@ -11,6 +11,7 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*;
import com.cool.store.request.TrainingExperienceDistributionRequest;
import com.cool.store.service.TrainingExperienceService;
import com.cool.store.utils.poi.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,15 +43,13 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
@Resource
EnterpriseUserMapper enterpriseUserMapper;
@Resource
RegionMapper regionMapper;
@Resource
UserAuthMappingMapper userAuthMappingMapper;
@Resource
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
@Resource
private CommonService commonService;
@Override
@Transactional(rollbackFor = Exception.class)
public boolean distribution(TrainingExperienceDistributionRequest request) {
@@ -69,6 +68,15 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
if (currentDate.before(request.getExperienceStartTime())) {
leaseBaseInfoDO.setExperienceStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_85.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_85.getCode());
//message
Map<String, String> requestMap = new HashMap<>();
LineInfoDO byLineId = lineInfoMapper.getByLineId(request.getLineId());
requestMap.put("partnerUsername",byLineId.getUsername());
requestMap.put("partnerMobile",byLineId.getMobile());
requestMap.put("lineId",String.valueOf(request.getLineId()));
commonService.sendMessage(Collections.singletonList(byLineId.getInvestmentManager()),
MessageEnum.MESSAGE_32,
requestMap);
} else if (currentDate.after(request.getExperienceStartTime()) || currentDate.before(request.getExperienceEndTime())) {
leaseBaseInfoDO.setExperienceStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_90.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_90.getCode());
@@ -98,6 +106,14 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.STORE_EXPERIENCE.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_95.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("partnerUsername",lineInfoDO.getUsername());
requestMap.put("partnerMobile",lineInfoDO.getMobile());
requestMap.put("lineId",String.valueOf(lineInfoDO.getId()));
commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()),
MessageEnum.MESSAGE_33,
requestMap);
}
}