Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init

This commit is contained in:
苏竹红
2024-05-23 14:22:39 +08:00
4 changed files with 32 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package com.cool.store.service;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.exception.ApiException;
import com.cool.store.request.FranchiseeSaveRequest;
import com.cool.store.request.InitiatingRequest;
import com.cool.store.request.IntentAgreementSubmitRequest;
@@ -26,7 +27,7 @@ public interface IntentAgreementService {
ResponseResult initiating(InitiatingRequest request,LoginUserInfo user);
ResponseResult save(FranchiseeSaveRequest request, LoginUserInfo user);
ResponseResult save(FranchiseeSaveRequest request, LoginUserInfo user) throws ApiException;
InitiatingRequest getOaDetail(String mobile, String idCardNo);
}

View File

@@ -5,6 +5,7 @@ import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.LineInfoDAO;
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.mapper.*;
import com.cool.store.mq.util.HttpRestTemplateService;
@@ -12,12 +13,14 @@ import com.cool.store.request.*;
import com.cool.store.response.InitiatingResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.SigningBaseInfoResponse;
import com.cool.store.service.AliyunService;
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 com.cool.store.vo.BusinessLicenseInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
@@ -70,6 +73,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Resource
private CommonService commonService;
@Resource
AliyunService aliyunService;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -237,7 +243,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
}
@Override
public ResponseResult save(FranchiseeSaveRequest request, LoginUserInfo user) {
public ResponseResult save(FranchiseeSaveRequest request, LoginUserInfo user) throws ApiException {
log.info("save request:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -272,6 +278,14 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
franchiseeDO.setCityCode(String.valueOf(openAreaInfoDO.getId()));
//todo 操作人工号 暂时写死
franchiseeDO.setOperator("22090043");
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(lineInfoDO.getId());
//如果是企业加盟,需要传有效期和法人
if (Objects.nonNull(memberQuestionDO) && Constants.TWO_INTEGER.equals(memberQuestionDO.getJoinType())){
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null,lineInfoDO.getId());
BusinessLicenseInfoVO businessLicenseInfo = aliyunService.getBusinessLicenseInfo(signingBaseInfoDO.getBusinessLicense());
franchiseeDO.setBusinessTerm(businessLicenseInfo.getValidPeriod());
franchiseeDO.setLegalPerson(businessLicenseInfo.getLegalPerson());
}
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class);
//更新线索(进入蓄水池并回填加盟商编码)
if (initiatingResponse.getCode() == 0) {

View File

@@ -12,6 +12,7 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.request.*;
import com.cool.store.service.*;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.vo.AuditInfoVO;
import com.cool.store.vo.LinePointBaseInfoVO;
@@ -904,6 +905,12 @@ public class PointServiceImpl implements PointService {
shopRentInfo.setId(rentContract.getId());
shopRentInfoDAO.updateRentContract(shopRentInfo);
}
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId());
Map<String, String> messageMap = new HashMap<>();
messageMap.put("lineId", String.valueOf(lineInfo.getId()));
messageMap.put("partnerUsername", lineInfo.getUsername());
messageMap.put("submitTime", DateUtils.parseDateToStr(DateUtils.NOTICE_DATE, new Date()));
commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()), MessageEnum.MESSAGE_15, messageMap);
return shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21);
}