feat:正新

This commit is contained in:
苏竹红
2025-11-25 13:50:30 +08:00
parent 537ecb2f61
commit 19376134d0
5 changed files with 254 additions and 6 deletions

View File

@@ -185,6 +185,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
if (Objects.isNull(request.getShopId())) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
//校验金额
if (!feeCheck(request)){
throw new ServiceException(ErrorCodeEnum.FEE_NOT_CONSISTENT);
}
SignFranchiseDO isExist = signFranchiseMapper.selectByShopId(request.getShopId());
if (Objects.nonNull(isExist) && Objects.isNull(request.getId())) {
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
@@ -268,6 +272,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
if (Objects.isNull(request.getShopId())) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
//校验金额
if (!feeCheck(request)){
throw new ServiceException(ErrorCodeEnum.FEE_NOT_CONSISTENT);
}
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
PointInfoDO pointInfoById = pointInfoDAO.getPointInfoById(shopInfoDO.getPointId());
SignFranchiseDO signFranchiseDO = request.toSignFranchiseDO();
@@ -298,6 +306,39 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
return Boolean.TRUE;
}
/**
* 费用校验
* @param request
* @return
*/
private Boolean feeCheck(AddSignFranchiseRequest request){
//查询账单金额
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
if (!request.getContractFranchiseFee().equals(franchiseFeeDO.getYearFranchiseFee())){
return Boolean.FALSE;
}
//合同设计费
if (!request.getContractPerformanceBond().equals(franchiseFeeDO.getPerformanceBond())){
return Boolean.FALSE;
}
//品牌使用费
if (!request.getContractBrandUseFee().equals(franchiseFeeDO.getFirstYearFee())){
return Boolean.FALSE;
}
//合同保证金
if (!request.getContractLoanMargin().equals(franchiseFeeDO.getLoanMargin())){
return Boolean.FALSE;
}
//合同管理费
if (!request.getContractManageFee().equals(franchiseFeeDO.getFirstYearManageFee())){
return Boolean.FALSE;
}
return Boolean.TRUE;
}
private void updateShopAndPoint(AddSignFranchiseRequest request, ShopInfoDO shopInfoDO, PointInfoDO pointInfoById) {
//店铺信息
shopInfoDO.setManagerRegionId(request.getManagerRegionId());
@@ -506,6 +547,21 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
contractInformationDTO.setFirstYearManagementFee(franchiseFeeDO.getFirstYearManageFee());
contractInformationDTO.setYearFranchiseFee(franchiseFeeDO.getYearFranchiseFee());
contractInformationDTO.setPerformanceBond(franchiseFeeDO.getPerformanceBond());
contractInformationDTO.setContractFranchiseFee(signFranchiseDO.getContractFranchiseFee());
contractInformationDTO.setContractManageFee(signFranchiseDO.getContractManageFee());
contractInformationDTO.setContractBrandUseFee(signFranchiseDO.getContractBrandUseFee());
contractInformationDTO.setContractPerformanceBond(signFranchiseDO.getContractPerformanceBond());
contractInformationDTO.setContractLoanMargin(signFranchiseDO.getContractLoanMargin());
contractInformationDTO.setContractSysUserFee(signFranchiseDO.getContractSysUserFee());
contractInformationDTO.setSignModality(signFranchiseDO.getSignModality());
contractInformationDTO.setFranchiseFeeFrequency(signFranchiseDO.getFranchiseFeeFrequency());
contractInformationDTO.setBrandUseFeeFrequency(signFranchiseDO.getBrandUseFeeFrequency());
contractInformationDTO.setJoinSource(signFranchiseDO.getJoinSource());
contractInformationDTO.setManageFeeFrequency(signFranchiseDO.getManageFeeFrequency());
contractInformationDTO.setDiscountAmount(signFranchiseDO.getDiscountAmount());
//老店转加盟(也叫直营转加盟)
if (SignTypeEnum.DIRECT_SALES_TO_JOINING.getCode().equals(signFranchiseDO.getSignType())){
contractInformationDTO.setOldShopCode(signFranchiseDO.getOldShopCode());