Merge #34 into master from cc_20260116_new_field
fix:加盟合同新增字段推送红圈通
* cc_20260116_new_field: (5 commits squashed)
- fix:加盟合同新增字段
- fix:加盟合同新增字段
- Merge branch 'refs/heads/master' into cc_20260116_new_field
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/SignFranchiseServiceImpl.java
- fix:加盟合同新增字段推送红圈通
- Merge branch 'master' into cc_20260116_new_field
# Conflicts:
#	coolstore-partner-model/src/main/java/com/cool/store/entity/ShopInfoDO.java
Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/34
This commit is contained in:
@@ -7,8 +7,7 @@ import com.cool.store.dto.HqtTokenDTO;
|
||||
import com.cool.store.entity.BigRegionDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.HqtEnum.HqtShopDecorationAttributesEnum;
|
||||
import com.cool.store.enums.HqtEnum.HqtSignFeeEnum;
|
||||
import com.cool.store.enums.HqtEnum.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.ConfirmQuotationRequest;
|
||||
import com.cool.store.request.HqtBuildRequest;
|
||||
@@ -16,12 +15,10 @@ import com.cool.store.request.HqtPartnerAcceptanceRequest;
|
||||
import com.cool.store.request.hqt.*;
|
||||
import com.cool.store.response.HqtAPIResponse;
|
||||
import com.cool.store.service.HqtAPIService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -29,6 +26,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
@@ -80,6 +78,23 @@ public class HqtAPIServiceImpl implements HqtAPIService {
|
||||
|
||||
HqtBuildAPIRequest hqtBuildAPIRequest = new HqtBuildAPIRequest();
|
||||
getHqtBuildAPIRequest(request, hqtBuildAPIRequest, field13__c, field124__c, field8__c, field123__c);
|
||||
// 特殊情况说明
|
||||
hqtBuildAPIRequest.setField195__c(request.getSpecialInstruction());
|
||||
// 装修设计要求
|
||||
HqtDecorationReqEnum decorationRequirement = HqtDecorationReqEnum.getByColumnCode(request.getDecorationRequirement());
|
||||
if (Objects.nonNull(decorationRequirement)) {
|
||||
hqtBuildAPIRequest.setField194__c(new HqtBuildAPIRequest.Field8__c(decorationRequirement.getCode(), decorationRequirement.getMsg()));
|
||||
}
|
||||
// 装修等级
|
||||
HqtDecorationLevelEnum decorationLevel = HqtDecorationLevelEnum.getByColumnCode(request.getDecorationLevel());
|
||||
if (Objects.nonNull(decorationLevel)) {
|
||||
hqtBuildAPIRequest.setField193__c(new HqtBuildAPIRequest.Field8__c(decorationLevel.getCode(), decorationLevel.getMsg()));
|
||||
}
|
||||
// 门店类型
|
||||
HqtStoreTypeEnum storeType = HqtStoreTypeEnum.getByStoreType(request.getStoreType());
|
||||
if (Objects.nonNull(storeType)) {
|
||||
hqtBuildAPIRequest.setField192__c(new HqtBuildAPIRequest.Field8__c(storeType.getCode(), storeType.getMsg()));
|
||||
}
|
||||
//资源服务URL
|
||||
String url = hqtToken.getEndPoint();
|
||||
String requestUrl = url + "/v1/data/objects/project3X";
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.constants.DictConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.ContractInformationDTO;
|
||||
@@ -28,6 +29,7 @@ import com.cool.store.request.*;
|
||||
import com.cool.store.response.AddSignFranchiseResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.dict.impl.DictService;
|
||||
import com.cool.store.utils.GeoMapUtil;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
@@ -153,6 +155,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
private SimpleMessageService simpleMessageService;
|
||||
@Resource
|
||||
private OperationsConsultantAssignDAO operationsConsultantAssignDAO;
|
||||
@Resource
|
||||
private DictService dictService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -222,6 +226,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
if (Objects.nonNull(isExist) && Objects.isNull(request.getId())) {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
// 正新鸡排校验字段
|
||||
verifyParams(request);
|
||||
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||
PointInfoDO pointInfoById = pointInfoDAO.getPointInfoById(shopInfoDO.getPointId());
|
||||
String lockKey = "submitSignFranchise:" + request.getShopId();
|
||||
@@ -292,6 +298,31 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
|
||||
}
|
||||
|
||||
public void verifyParams(AddSignFranchiseRequest request) {
|
||||
// 正新鸡排校验字段
|
||||
if (String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(request.getFranchiseBrand())) {
|
||||
if (Objects.isNull(request.getChickenAmount())) {
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "鸡排价格不能为空");
|
||||
}
|
||||
if (BigDecimal.valueOf(10).compareTo(request.getChickenAmount()) != 0 && StringUtils.isBlank(request.getChickenInstruction())) {
|
||||
throw new ServiceException(ErrorCodeEnum.ZXJP_AMOUNT_INSTRUCTION_IS_BLANK);
|
||||
}
|
||||
if (Objects.isNull(request.getShopDecorationAttributes())) {
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "门店装修属性不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(request.getDecorationLevel())) {
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "门店装修等级不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(request.getDecorationRequirement())) {
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "门店装修要求不能为空");
|
||||
}
|
||||
// 门店类型为‘普通门店’或装修设计要求不为‘统一装修设计’时,特殊情况说明必填
|
||||
if (StringUtils.isBlank(request.getSpecialInstruction()) && (Integer.valueOf(2).equals(request.getStoreType()) || !DictConstants.DECORATION_REQUIREMENT_UNIFORM.equals(request.getDecorationRequirement()))) {
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "特殊情况说明不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -307,6 +338,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
if (!feeCheck(request)){
|
||||
throw new ServiceException(ErrorCodeEnum.FEE_NOT_CONSISTENT);
|
||||
}
|
||||
// 正新鸡排校验字段
|
||||
verifyParams(request);
|
||||
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||
PointInfoDO pointInfoById = pointInfoDAO.getPointInfoById(shopInfoDO.getPointId());
|
||||
SignFranchiseDO signFranchiseDO = request.toSignFranchiseDO();
|
||||
@@ -392,6 +425,11 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
shopInfoDO.setUpdateTime(new Date());
|
||||
shopInfoDO.setStoreType(request.getStoreType());
|
||||
shopInfoDO.setShopDecorationAttributes(request.getShopDecorationAttributes());
|
||||
shopInfoDO.setChickenAmount(request.getChickenAmount());
|
||||
shopInfoDO.setChickenInstruction(request.getChickenInstruction());
|
||||
shopInfoDO.setDecorationLevel(request.getDecorationLevel());
|
||||
shopInfoDO.setDecorationRequirement(request.getDecorationRequirement());
|
||||
shopInfoDO.setSpecialInstruction(request.getSpecialInstruction());
|
||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||
if (Objects.nonNull(pointInfoById)) {
|
||||
pointInfoById.setProvince(request.getProvince());
|
||||
@@ -766,6 +804,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
request.setPartnershipSignatoryFirstMobile(lineInfoDO.getMobile());
|
||||
request.setShopAddress(shopInfo.getDetailAddress());
|
||||
request.setIsPayDesignFee(CommonConstants.ONE);
|
||||
request.setDecorationLevel(shopInfo.getDecorationLevel());
|
||||
request.setDecorationRequirement(shopInfo.getDecorationRequirement());
|
||||
request.setSpecialInstruction(shopInfo.getSpecialInstruction());
|
||||
request.setStoreType(shopInfo.getStoreType());
|
||||
if (StringUtils.isNotEmpty(shopInfo.getOperationsConsultant())){
|
||||
String userName = enterpriseUserDAO.getUserName(shopInfo.getOperationsConsultant());
|
||||
request.setOperationsConsultant(userName);
|
||||
@@ -874,6 +916,12 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
addSignFranchiseResponse.setShopCode(shopInfoDO.getShopCode());
|
||||
addSignFranchiseResponse.setFranchiseBrand(shopInfoDO.getFranchiseBrand());
|
||||
addSignFranchiseResponse.setJoinMode(shopInfoDO.getJoinMode());
|
||||
addSignFranchiseResponse.setChickenAmount(shopInfoDO.getChickenAmount());
|
||||
addSignFranchiseResponse.setChickenInstruction(shopInfoDO.getChickenInstruction());
|
||||
addSignFranchiseResponse.setDecorationLevel(shopInfoDO.getDecorationLevel());
|
||||
addSignFranchiseResponse.setDecorationRequirement(shopInfoDO.getDecorationRequirement());
|
||||
addSignFranchiseResponse.setSpecialInstruction(shopInfoDO.getSpecialInstruction());
|
||||
dictService.fillDictField(addSignFranchiseResponse);
|
||||
|
||||
if (Objects.nonNull(regionInfo)) {
|
||||
addSignFranchiseResponse.setRegionId(shopInfoDO.getRegionId());
|
||||
|
||||
Reference in New Issue
Block a user