Merge #93 into master from cc_20260413_fix

feat:ai店限制

* cc_20260413_fix: (2 commits squashed)

  - feat:加盟类费用完成 但是可乐机没有完成 设置标识 可乐机完成的时候查询如果有这个标识 更新阶段完成

  - feat:ai店限制

Signed-off-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/93
This commit is contained in:
正新
2026-04-13 09:27:43 +00:00
parent 3602392d8d
commit 1381af4eec
8 changed files with 83 additions and 2 deletions

View File

@@ -404,4 +404,9 @@ public class RedisConstant {
* IP限制key
*/
public static final String IP_LIMIT = "ip_limit";
/**
* 新管家缴费回调完成 标识
*/
public static final String XGJ_CALLBACK_SHOP = "xgj_callback_shop:{0}";
}

View File

@@ -366,6 +366,7 @@ public enum ErrorCodeEnum {
ORDER_DATA_EXCEPTION(1610113, "心愿单数据异常!", null),
CURRENT_WISHLIST_NOT_EXIST(1610114, "当前心愿单不存在!", null),
AMOUNT_GEN_ZERO(1610115, "分账金额必须大于0", null),
AI_NOT_SUPPORT_OPERATION(1610116, "AI标准店不支持退回到缴费阶段", null),

View File

@@ -29,7 +29,11 @@ public class PreAllocationRecordDAO {
return preAllocationRecordMapper.queryPageByShopId(shopId);
}
public List<PreAllocationRecordDO> queryPageByPayNo(String payNo) {
public PreAllocationRecordDO queryPageByShopIdAndExpenseType(Long shopId,String expenseType) {
return preAllocationRecordMapper.queryPageByShopIdAndExpenseType(shopId,expenseType);
}
public PreAllocationRecordDO queryPageByPayNo(String payNo) {
return preAllocationRecordMapper.queryPageByPayNo(payNo);
}

View File

@@ -14,7 +14,9 @@ public interface PreAllocationRecordMapper extends Mapper<PreAllocationRecordDO>
List<PreAllocationRecordDO> queryPageByShopId(@Param("shopId") Long shopId);
List<PreAllocationRecordDO> queryPageByPayNo(@Param("payNo") String payNo);
PreAllocationRecordDO queryPageByShopIdAndExpenseType(Long shopId,String expenseType);
PreAllocationRecordDO queryPageByPayNo(@Param("payNo") String payNo);
int updateStatus(@Param("id") Long id, @Param("status") Integer status);

View File

@@ -41,6 +41,14 @@
ORDER BY create_time DESC
</select>
<select id="queryPageByShopIdAndExpenseType" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM zxjp_pre_allocation_record
WHERE shop_id = #{shopId}
and expense_type = #{expenseType}
ORDER BY create_time DESC
</select>
<select id="queryPageByPayNo" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM zxjp_pre_allocation_record

View File

@@ -7,10 +7,15 @@ import com.cool.store.dao.FranchiseFeeDAO;
import com.cool.store.dao.PointDetailInfoDAO;
import com.cool.store.dao.PointInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.dao.fees.WalletPayInfoDAO;
import com.cool.store.dao.order.PreAllocationRecordDAO;
import com.cool.store.entity.*;
import com.cool.store.entity.fees.ShopAllocationInfoDO;
import com.cool.store.entity.fees.WalletPayInfoDO;
import com.cool.store.entity.order.PreAllocationRecordDO;
import com.cool.store.enums.*;
import com.cool.store.enums.fees.PayTypeEnum;
import com.cool.store.enums.fees.WalletFeeItemEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
@@ -29,15 +34,18 @@ import com.cool.store.service.UserAuthMappingService;
import com.cool.store.service.dict.impl.DictService;
import com.cool.store.service.fees.PayeeBankConfigService;
import com.cool.store.service.fees.ShopAllocationInfoService;
import com.cool.store.service.fees.WalletPayInfoService;
import com.cool.store.utils.BeanUtil;
import com.cool.store.utils.CommonUtil;
import com.cool.store.utils.RedisUtil;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.fees.PayeeBankConfigSimpleVO;
import com.cool.store.vo.fees.PayeeBankConfigVO;
import com.cool.store.vo.fees.ShopAllocationInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -92,6 +100,14 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
private DictService dictService;
@Resource
private RedisUtil redisUtil;
@Autowired
private PreAllocationRecordDAO preAllocationRecordDAO;
@Autowired
private WalletPayInfoService walletPayInfoService;
@Autowired
private WalletPayInfoDAO walletPayInfoDAO;
@Resource
RedisUtilPool redisUtilPool;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -321,6 +337,24 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
//标准店
stageList.add(SHOP_SUB_STAGE_STATUS_285);
stageList.add(SHOP_SUB_STAGE_STATUS_80);
//查询可乐机缴费状态
PreAllocationRecordDO preAllocationRecordDO = preAllocationRecordDAO.queryPageByShopIdAndExpenseType(request.getShopId(), WalletFeeItemEnum.DEVICE_EARNEST_MONEY.getExpenseType());
if (preAllocationRecordDAO!=null){
WalletPayInfoDO byPayNo = walletPayInfoDAO.getByPayNo(preAllocationRecordDO.getPayNo());
//加盟费缴纳完成且可乐机认领完成
if (XGJCollectionStatusEnum.COMPLETED.getCode().equals(request.getPaymentStatus())&&byPayNo.getClaimStatus()==1){
shopStageInfoDAO.batchUpdateShopStageStatus(request.getShopId(),stageList);
}
//加盟类费用完成 但是可乐机没有完成 设置标识 可乐机完成的时候查询如果有这个标识 更新阶段完成
if (XGJCollectionStatusEnum.COMPLETED.getCode().equals(request.getPaymentStatus())&&byPayNo.getClaimStatus()==0){
///缓存完成标志
String key = MessageFormat.format(RedisConstant.XGJ_CALLBACK_SHOP, request.getShopId());
redisUtilPool.setString(key,String.valueOf(request.getShopId()));
}
}
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
//标准店直接退出
return ApiResponse.success(Boolean.TRUE);
}
if (request.getPayableFee().compareTo(request.getPaidFees())==-1){

View File

@@ -1,20 +1,24 @@
package com.cool.store.service.impl;
import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.PosAndOrderInfoDAO;
import com.cool.store.dao.ShopAccountDAO;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.dao.fees.WalletPayInfoDAO;
import com.cool.store.dao.order.PreAllocationRecordDAO;
import com.cool.store.dto.BatchStatusRefreshDTO;
import com.cool.store.dto.StatusRefreshDTO;
import com.cool.store.entity.ShopAccountDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.entity.fees.WalletPayInfoDO;
import com.cool.store.entity.order.PreAllocationRecordDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.OpenStatusEnum;
import com.cool.store.enums.PosAndOrderEnum;
import com.cool.store.enums.ShopAccountEnum;
import com.cool.store.enums.fees.WalletFeeItemEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.PostAndOrderRequest;
@@ -25,18 +29,24 @@ import com.cool.store.service.FranchiseFeeService;
import com.cool.store.service.LinePayService;
import com.cool.store.service.OpenApiService;
import com.cool.store.service.PosAndOrderInfoService;
import com.cool.store.utils.RedisUtilPool;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import static com.cool.store.enums.point.ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_285;
import static com.cool.store.enums.point.ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80;
/**
* @Author suzhuhong
* @Date 2025/4/7 16:54
@@ -63,6 +73,11 @@ public class OpenApiServiceImpl implements OpenApiService {
FranchiseFeeService franchiseFeeService;
@Resource
WalletPayInfoDAO walletPayInfoDAO;
@Autowired
private PreAllocationRecordDAO preAllocationRecordDAO;
@Resource
RedisUtilPool redisUtilPool;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -107,6 +122,14 @@ public class OpenApiServiceImpl implements OpenApiService {
public ApiResponse<Boolean> changeReceiptStatus(ReceiptCallBackRequest request) {
if (Objects.nonNull(request.getPayWay()) && CommonConstants.INDEX_TWO.equals(request.getPayWay())) {
walletPayInfoDAO.updateClaimStatusByPayNo(request.getReceiptId(), request.getClaimStatus());
PreAllocationRecordDO preAllocationRecordDO = preAllocationRecordDAO.queryPageByPayNo(request.getReceiptId());
//认领完成 且是可乐机认领 完成状态
if (request.getClaimStatus() == 1 && preAllocationRecordDO!=null&&WalletFeeItemEnum.DEVICE_EARNEST_MONEY.getExpenseType().equals(preAllocationRecordDO.getExpenseType())){
String key = MessageFormat.format(RedisConstant.XGJ_CALLBACK_SHOP, preAllocationRecordDO.getShopId());
if (StringUtils.isNotEmpty(redisUtilPool.getString(key))){
shopStageInfoDAO.batchUpdateShopStageStatus(preAllocationRecordDO.getShopId(),Arrays.asList(SHOP_SUB_STAGE_STATUS_285,SHOP_SUB_STAGE_STATUS_80));
}
}
return ApiResponse.success(Boolean.TRUE);
} else {
return linePayService.ReceiptCallBack(request);

View File

@@ -1145,6 +1145,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
@Override
public Boolean backPayFeeStage(AuditApproveRequest request, LoginUserInfo user) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
if (shopInfo!=null&&shopInfo.getUseStandardStore()==1){
throw new ServiceException(ErrorCodeEnum.AI_NOT_SUPPORT_OPERATION);
}
//回退到对账中 此阶段账单可编辑 可再次对账
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
//缴费阶段回退到未开始