特许经营合同有数据未完成时抛出异常
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public enum ApiErrorCodeEnum {
|
||||||
|
LINE_INFO("lineInfoDO","线索信息确实"),
|
||||||
|
FRANCHISE_FEE("franchiseFeeDO","缴费信息缺失"),
|
||||||
|
SIGNING_BASE_INFO("signingBaseInfoDO","签约信息缺失"),
|
||||||
|
LINE_PAY("linePayDO","缴款信息缺失"),
|
||||||
|
POINT_INFO("pointInfoDO","铺位信息缺失"),
|
||||||
|
SYSTEM_BUILDING_SHOP("systemBuildingShopDO","建店数据缺失"),
|
||||||
|
LICENSE_TRANSACT("licenseTransactDO","证照办理数据缺失"),
|
||||||
|
THIRD_DEPARTMENT("thirdDepartmentDO","三方部门表缺失"),
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
private String errorMessage;
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
ApiErrorCodeEnum(String code, String errorMessage) {
|
||||||
|
this.code = code;
|
||||||
|
this.errorMessage = errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorMessage() {
|
||||||
|
return errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
protected static final Map<String, ApiErrorCodeEnum> map = Arrays.stream(values()).collect(
|
||||||
|
Collectors.toMap(ApiErrorCodeEnum::getCode, Function.identity(), (a, b)->a));
|
||||||
|
|
||||||
|
public static ApiErrorCodeEnum getByCode(String code) {
|
||||||
|
return map.get(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -163,29 +163,52 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
|||||||
Long shopId = request.getShopId();
|
Long shopId = request.getShopId();
|
||||||
//线索信息
|
//线索信息
|
||||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
||||||
|
if (Objects.isNull(lineInfoDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("lineInfoDO").getErrorMessage());
|
||||||
|
}
|
||||||
//缴费信息
|
//缴费信息
|
||||||
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
|
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
|
||||||
|
if (Objects.isNull(franchiseFeeDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("franchiseFeeDO").getErrorMessage());
|
||||||
|
}
|
||||||
//线索id
|
//线索id
|
||||||
Long lineId = shopInfoDO.getLineId();
|
Long lineId = shopInfoDO.getLineId();
|
||||||
//签约信息
|
//签约信息
|
||||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineId);
|
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineId);
|
||||||
|
if (Objects.isNull(signingBaseInfoDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("signingBaseInfoDO").getErrorMessage());
|
||||||
|
}
|
||||||
//缴款信息
|
//缴款信息
|
||||||
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId, 1, shopId);
|
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId, 1, shopId);
|
||||||
|
if (Objects.isNull(linePayDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("linePayDO").getErrorMessage());
|
||||||
|
}
|
||||||
//铺位信息
|
//铺位信息
|
||||||
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
|
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
|
||||||
|
if (Objects.isNull(pointInfoDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("pointInfoDO").getErrorMessage());
|
||||||
|
}
|
||||||
//建店数据
|
//建店数据
|
||||||
SystemBuildingShopDO systemBuildingShopDO = systemBuildingShopMapper.selectOne(SystemBuildingShopDO.builder().shopId(shopId).lineId(lineId).build());
|
SystemBuildingShopDO systemBuildingShopDO = systemBuildingShopMapper.selectOne(SystemBuildingShopDO.builder().shopId(shopId).lineId(lineId).build());
|
||||||
|
if (Objects.isNull(systemBuildingShopDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("systemBuildingShopDO").getErrorMessage());
|
||||||
|
}
|
||||||
//证照办理
|
//证照办理
|
||||||
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId);
|
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId);
|
||||||
|
if (Objects.isNull(licenseTransactDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("licenseTransactDO").getErrorMessage());
|
||||||
|
}
|
||||||
ThirdDepartmentDO thirdDepartmentDO = new ThirdDepartmentDO();
|
ThirdDepartmentDO thirdDepartmentDO = new ThirdDepartmentDO();
|
||||||
if (Objects.nonNull(systemBuildingShopDO)) {
|
if (Objects.nonNull(systemBuildingShopDO)) {
|
||||||
//三方部门表
|
//三方部门表
|
||||||
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
|
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
|
||||||
|
if (Objects.isNull(thirdDepartmentDO)){
|
||||||
|
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("thirdDepartmentDO").getErrorMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//找不到的url统一用这个
|
//找不到的url统一用这个
|
||||||
List<String> temp = new ArrayList<>();
|
List<String> temp = new ArrayList<>();
|
||||||
temp.add("object");
|
temp.add("object");
|
||||||
Convert.digitToChinese(123);
|
|
||||||
return FranchiseAgreementRequest.builder()
|
return FranchiseAgreementRequest.builder()
|
||||||
// todo .apply_user(user.getJobNumber())
|
// todo .apply_user(user.getJobNumber())
|
||||||
.apply_user("20230724")
|
.apply_user("20230724")
|
||||||
|
|||||||
Reference in New Issue
Block a user