feat:老店新开特殊处理
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
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.mapper.SignFranchiseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -38,4 +40,11 @@ public class SignFranchiseDAO {
|
||||
public SignFranchiseDO selectByShopId(Long 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,5 +41,7 @@ public class ContractInformationDTO {
|
||||
private String payeeName;
|
||||
@ApiModelProperty("品牌方")
|
||||
private String brandOwner;
|
||||
@ApiModelProperty("老店编码 签约类型选择老店转加盟时有")
|
||||
private String oldShopCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,4 +14,6 @@ public class ContractCallbackDTO {
|
||||
|
||||
private String reason;
|
||||
|
||||
private String storeCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -96,4 +96,7 @@ public class SignFranchiseDO {
|
||||
*/
|
||||
@Column(name = "reason")
|
||||
private String reason;
|
||||
|
||||
@Column(name = "old_shop_code")
|
||||
private String oldShopCode;
|
||||
}
|
||||
|
||||
@@ -148,6 +148,9 @@ public class AddSignFranchiseRequest {
|
||||
@ApiModelProperty("是否统管 : 1-统管,0-不统管")
|
||||
private Integer unifiedManagement;
|
||||
|
||||
@ApiModelProperty("老店编码 签约类型选择老店转加盟时有")
|
||||
private String oldShopCode;
|
||||
|
||||
|
||||
|
||||
public SignFranchiseDO toSignFranchiseDO() {
|
||||
@@ -161,6 +164,7 @@ public class AddSignFranchiseRequest {
|
||||
signFranchiseDO.setContractStartTime(this.contractStartTime);
|
||||
signFranchiseDO.setContractEndTime(this.contractStartEndTime);
|
||||
signFranchiseDO.setImpressionNum(this.impressionNum);
|
||||
signFranchiseDO.setOldShopCode(this.oldShopCode);
|
||||
// signFranchiseDO.setBusinessStartHours(setMill(this.businessStartHours));
|
||||
// signFranchiseDO.setBusinessEndHours(setMill(this.businessEndHours));
|
||||
// signFranchiseDO.setIrregularReason(this.irregularReason);
|
||||
|
||||
@@ -245,6 +245,6 @@ public class AddSignFranchiseResponse {
|
||||
private Integer infoConsistencyFlag;
|
||||
@ApiModelProperty("不一致原因")
|
||||
private String reason;
|
||||
|
||||
|
||||
@ApiModelProperty("老店编码 签约类型选择老店转加盟时有")
|
||||
private String oldShopCode;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
private EnterpriseUserRoleDao enterpriseUserRoleDao;
|
||||
@Resource
|
||||
SignFranchiseMapper signFranchiseMapper;
|
||||
@Resource
|
||||
SignFranchiseDAO signFranchiseDAO;
|
||||
|
||||
@Resource
|
||||
UserAuthMappingService userAuthMappingService;
|
||||
@@ -227,7 +229,11 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
//如果已经签约 修改之后从新推送数据
|
||||
ContractCallbackDTO contractCallbackDTO = pushContractRequest(shopInfoDO, request.getShopId());
|
||||
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);
|
||||
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());
|
||||
operationLogService.batchUpdateProcessed(operationLogs, auditId, user.getUserId(), request.getCause());
|
||||
@@ -495,6 +505,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
contractInformationDTO.setFirstYearManagementFee(franchiseFeeDO.getFirstYearManageFee());
|
||||
contractInformationDTO.setYearFranchiseFee(franchiseFeeDO.getYearFranchiseFee());
|
||||
contractInformationDTO.setPerformanceBond(franchiseFeeDO.getPerformanceBond());
|
||||
contractInformationDTO.setOldShopCode(signFranchiseDO.getOldShopCode());
|
||||
|
||||
FranchiseBrandEnum enumByCode = FranchiseBrandEnum.getEnumByCode(shopInfoDO.getFranchiseBrand());
|
||||
if (enumByCode != null){
|
||||
|
||||
Reference in New Issue
Block a user