feat:老店新开特殊处理

This commit is contained in:
苏竹红
2025-10-10 10:06:11 +08:00
parent 59ca00cc2d
commit 89e9cf3b57
7 changed files with 35 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
package com.cool.store.dao; package com.cool.store.dao;
import com.alibaba.excel.util.CollectionUtils; import com.alibaba.excel.util.CollectionUtils;
import com.alibaba.excel.util.StringUtils;
import com.cool.store.dto.contract.ContractCallbackDTO;
import com.cool.store.entity.SignFranchiseDO; import com.cool.store.entity.SignFranchiseDO;
import com.cool.store.mapper.SignFranchiseMapper; import com.cool.store.mapper.SignFranchiseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@@ -38,4 +40,11 @@ public class SignFranchiseDAO {
public SignFranchiseDO selectByShopId(Long shopId){ public SignFranchiseDO selectByShopId(Long shopId){
return signFranchiseMapper.selectByShopId(shopId); return signFranchiseMapper.selectByShopId(shopId);
} }
public void updateAuditByShopId(Long auditId, Long shopId, ContractCallbackDTO dto){
if (dto==null || (StringUtils.isEmpty(dto.getReason())&&dto.getInfoConsistencyFlag()==null)){
return;
}
signFranchiseMapper.updateAuditByShopId(auditId,shopId,dto);
}
} }

View File

@@ -41,5 +41,7 @@ public class ContractInformationDTO {
private String payeeName; private String payeeName;
@ApiModelProperty("品牌方") @ApiModelProperty("品牌方")
private String brandOwner; private String brandOwner;
@ApiModelProperty("老店编码 签约类型选择老店转加盟时有")
private String oldShopCode;
} }

View File

@@ -14,4 +14,6 @@ public class ContractCallbackDTO {
private String reason; private String reason;
private String storeCode;
} }

View File

@@ -96,4 +96,7 @@ public class SignFranchiseDO {
*/ */
@Column(name = "reason") @Column(name = "reason")
private String reason; private String reason;
@Column(name = "old_shop_code")
private String oldShopCode;
} }

View File

@@ -148,6 +148,9 @@ public class AddSignFranchiseRequest {
@ApiModelProperty("是否统管 1-统管0-不统管") @ApiModelProperty("是否统管 1-统管0-不统管")
private Integer unifiedManagement; private Integer unifiedManagement;
@ApiModelProperty("老店编码 签约类型选择老店转加盟时有")
private String oldShopCode;
public SignFranchiseDO toSignFranchiseDO() { public SignFranchiseDO toSignFranchiseDO() {
@@ -161,6 +164,7 @@ public class AddSignFranchiseRequest {
signFranchiseDO.setContractStartTime(this.contractStartTime); signFranchiseDO.setContractStartTime(this.contractStartTime);
signFranchiseDO.setContractEndTime(this.contractStartEndTime); signFranchiseDO.setContractEndTime(this.contractStartEndTime);
signFranchiseDO.setImpressionNum(this.impressionNum); signFranchiseDO.setImpressionNum(this.impressionNum);
signFranchiseDO.setOldShopCode(this.oldShopCode);
// signFranchiseDO.setBusinessStartHours(setMill(this.businessStartHours)); // signFranchiseDO.setBusinessStartHours(setMill(this.businessStartHours));
// signFranchiseDO.setBusinessEndHours(setMill(this.businessEndHours)); // signFranchiseDO.setBusinessEndHours(setMill(this.businessEndHours));
// signFranchiseDO.setIrregularReason(this.irregularReason); // signFranchiseDO.setIrregularReason(this.irregularReason);

View File

@@ -245,6 +245,6 @@ public class AddSignFranchiseResponse {
private Integer infoConsistencyFlag; private Integer infoConsistencyFlag;
@ApiModelProperty("不一致原因") @ApiModelProperty("不一致原因")
private String reason; private String reason;
@ApiModelProperty("老店编码 签约类型选择老店转加盟时有")
private String oldShopCode;
} }

View File

@@ -62,6 +62,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
private EnterpriseUserRoleDao enterpriseUserRoleDao; private EnterpriseUserRoleDao enterpriseUserRoleDao;
@Resource @Resource
SignFranchiseMapper signFranchiseMapper; SignFranchiseMapper signFranchiseMapper;
@Resource
SignFranchiseDAO signFranchiseDAO;
@Resource @Resource
UserAuthMappingService userAuthMappingService; UserAuthMappingService userAuthMappingService;
@@ -227,7 +229,11 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
//如果已经签约 修改之后从新推送数据 //如果已经签约 修改之后从新推送数据
ContractCallbackDTO contractCallbackDTO = pushContractRequest(shopInfoDO, request.getShopId()); ContractCallbackDTO contractCallbackDTO = pushContractRequest(shopInfoDO, request.getShopId());
if (!Objects.isNull(contractCallbackDTO)){ if (!Objects.isNull(contractCallbackDTO)){
signFranchiseMapper.updateAuditByShopId(null, request.getShopId(),contractCallbackDTO); if (StringUtils.isNoneEmpty(contractCallbackDTO.getStoreCode())){
shopInfoDO.setShopCode(contractCallbackDTO.getStoreCode());
shopInfoDAO.updateShopInfo(shopInfoDO);
}
signFranchiseDAO.updateAuditByShopId(null, request.getShopId(),contractCallbackDTO);
} }
} }
@@ -451,7 +457,11 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
} }
shopAuditInfoMapper.insertSelective(shopAuditInfoDO); shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
Long auditId = shopAuditInfoDO.getId(); Long auditId = shopAuditInfoDO.getId();
signFranchiseMapper.updateAuditByShopId(auditId, shopId,contractCallbackDTO); if (contractCallbackDTO!=null&&StringUtils.isNotEmpty(contractCallbackDTO.getStoreCode())){
shopInfoDO.setShopCode(contractCallbackDTO.getStoreCode());
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
}
signFranchiseDAO.updateAuditByShopId(auditId, shopId,contractCallbackDTO);
//审批记录表记录 //审批记录表记录
List<OperationLogDO> operationLogs = operationLogDAO.getBySubStageStatusEnumAndsStatus(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83, OperationTypeEnum.OPERATION_TYPE_1.getCode()); List<OperationLogDO> operationLogs = operationLogDAO.getBySubStageStatusEnumAndsStatus(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83, OperationTypeEnum.OPERATION_TYPE_1.getCode());
operationLogService.batchUpdateProcessed(operationLogs, auditId, user.getUserId(), request.getCause()); operationLogService.batchUpdateProcessed(operationLogs, auditId, user.getUserId(), request.getCause());
@@ -495,6 +505,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
contractInformationDTO.setFirstYearManagementFee(franchiseFeeDO.getFirstYearManageFee()); contractInformationDTO.setFirstYearManagementFee(franchiseFeeDO.getFirstYearManageFee());
contractInformationDTO.setYearFranchiseFee(franchiseFeeDO.getYearFranchiseFee()); contractInformationDTO.setYearFranchiseFee(franchiseFeeDO.getYearFranchiseFee());
contractInformationDTO.setPerformanceBond(franchiseFeeDO.getPerformanceBond()); contractInformationDTO.setPerformanceBond(franchiseFeeDO.getPerformanceBond());
contractInformationDTO.setOldShopCode(signFranchiseDO.getOldShopCode());
FranchiseBrandEnum enumByCode = FranchiseBrandEnum.getEnumByCode(shopInfoDO.getFranchiseBrand()); FranchiseBrandEnum enumByCode = FranchiseBrandEnum.getEnumByCode(shopInfoDO.getFranchiseBrand());
if (enumByCode != null){ if (enumByCode != null){