Merge #53 into master from cc_20260311_optimize
fix * cc_20260311_optimize: (2 commits squashed) - fix:未分配招商区域处理 - fix 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/53
This commit is contained in:
@@ -2,7 +2,10 @@ package com.cool.store.vo.fees;
|
|||||||
|
|
||||||
import com.cool.store.enums.master.BrandTypeEnum;
|
import com.cool.store.enums.master.BrandTypeEnum;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -10,6 +13,9 @@ import java.util.Date;
|
|||||||
* 线下收款银行配置VO
|
* 线下收款银行配置VO
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
public class PayeeBankConfigVO {
|
public class PayeeBankConfigVO {
|
||||||
@ApiModelProperty("id")
|
@ApiModelProperty("id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.service.fees.impl;
|
package com.cool.store.service.fees.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollStreamUtil;
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.RedisConstant;
|
import com.cool.store.constants.RedisConstant;
|
||||||
import com.cool.store.context.CurrentUserHolder;
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
@@ -21,6 +22,7 @@ import com.cool.store.request.fees.PayeeBankConfigPageRequest;
|
|||||||
import com.cool.store.service.fees.PayeeBankConfigService;
|
import com.cool.store.service.fees.PayeeBankConfigService;
|
||||||
import com.cool.store.utils.BeanUtil;
|
import com.cool.store.utils.BeanUtil;
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
import com.cool.store.vo.fees.PayeeBankConfigVO;
|
import com.cool.store.vo.fees.PayeeBankConfigVO;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
@@ -97,13 +99,33 @@ public class PayeeBankConfigServiceImpl implements PayeeBankConfigService {
|
|||||||
}
|
}
|
||||||
FranchiseFeeDO franchiseFeeDO = franchiseFeeDAO.selectByShopId(shopId);
|
FranchiseFeeDO franchiseFeeDO = franchiseFeeDAO.selectByShopId(shopId);
|
||||||
if (Objects.isNull(payType) && (Objects.isNull(franchiseFeeDO) || Objects.isNull(franchiseFeeDO.getPayType()))) {
|
if (Objects.isNull(payType) && (Objects.isNull(franchiseFeeDO) || Objects.isNull(franchiseFeeDO.getPayType()))) {
|
||||||
throw new ServiceException(ErrorCodeEnum.NO_PAYMENT_METHOD_IS_SET);
|
return getDefaultBankConfig(shopInfo.getFranchiseBrand());
|
||||||
}
|
}
|
||||||
RegionDO regionDO = regionDao.getRegionById(shopInfo.getInvestRegionId());
|
RegionDO regionDO = regionDao.getRegionById(shopInfo.getInvestRegionId());
|
||||||
|
if (Objects.isNull(regionDO)) {
|
||||||
|
return getDefaultBankConfig(shopInfo.getFranchiseBrand());
|
||||||
|
}
|
||||||
PayeeBankConfigDO configDO = payeeBankConfigDAO.getByUniqueKey(Integer.valueOf(shopInfo.getFranchiseBrand()), Long.valueOf(regionDO.getParentId()), Objects.nonNull(payType) ? payType : franchiseFeeDO.getPayType());
|
PayeeBankConfigDO configDO = payeeBankConfigDAO.getByUniqueKey(Integer.valueOf(shopInfo.getFranchiseBrand()), Long.valueOf(regionDO.getParentId()), Objects.nonNull(payType) ? payType : franchiseFeeDO.getPayType());
|
||||||
return BeanUtil.toBean(configDO, PayeeBankConfigVO.class);
|
return BeanUtil.toBean(configDO, PayeeBankConfigVO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PayeeBankConfigVO getDefaultBankConfig(String franchiseBrand) {
|
||||||
|
String bankInfoStr = redisUtilPool.getString(RedisConstant.BUILD_RECEIVE_BANK_INFO + ":" + franchiseBrand);
|
||||||
|
if (StringUtils.isBlank(bankInfoStr)) {
|
||||||
|
bankInfoStr = redisUtilPool.getString(RedisConstant.BUILD_RECEIVE_BANK_INFO + ":1");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(bankInfoStr)) {
|
||||||
|
JSONObject bankInfo = JSONObject.parseObject(bankInfoStr);
|
||||||
|
return PayeeBankConfigVO.builder()
|
||||||
|
.payeeName(bankInfo.getString("receivingFirmName"))
|
||||||
|
.payeeAccount(bankInfo.getString("receivingMsBankAccount"))
|
||||||
|
// .payeeBank()
|
||||||
|
.payeeBankBranch(bankInfo.getString("receivingMsBankBranch"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验:
|
* 校验:
|
||||||
* 1) 加盟品牌+招商分部+付款方式唯一
|
* 1) 加盟品牌+招商分部+付款方式唯一
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.cool.store.utils.BeanUtil;
|
|||||||
import com.cool.store.vo.dict.DictColumnSimpleVO;
|
import com.cool.store.vo.dict.DictColumnSimpleVO;
|
||||||
import com.cool.store.vo.fees.ShopAllocationSimpleVO;
|
import com.cool.store.vo.fees.ShopAllocationSimpleVO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
public class ShopAllocationInfoServiceImpl implements ShopAllocationInfoService {
|
public class ShopAllocationInfoServiceImpl implements ShopAllocationInfoService {
|
||||||
private final ShopAllocationInfoDAO shopAllocationInfoDAO;
|
private final ShopAllocationInfoDAO shopAllocationInfoDAO;
|
||||||
private final SysDictColumnDAO dictColumnDAO;
|
private final SysDictColumnDAO dictColumnDAO;
|
||||||
@@ -112,6 +114,10 @@ public class ShopAllocationInfoServiceImpl implements ShopAllocationInfoService
|
|||||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||||
}
|
}
|
||||||
RegionDO regionDO = regionDao.getRegionById(shopInfo.getInvestRegionId());
|
RegionDO regionDO = regionDao.getRegionById(shopInfo.getInvestRegionId());
|
||||||
|
if (Objects.isNull(regionDO)) {
|
||||||
|
log.error("未分配招商区域");
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
Integer joinBrand = Integer.valueOf(shopInfo.getFranchiseBrand());
|
Integer joinBrand = Integer.valueOf(shopInfo.getFranchiseBrand());
|
||||||
// 查询分账公司配置
|
// 查询分账公司配置
|
||||||
List<WalletAllocationConfigDO> allocationConfigList = walletAllocationConfigDAO.selectByBrandAndInvest(joinBrand, Long.valueOf(regionDO.getParentId()));
|
List<WalletAllocationConfigDO> allocationConfigList = walletAllocationConfigDAO.selectByBrandAndInvest(joinBrand, Long.valueOf(regionDO.getParentId()));
|
||||||
|
|||||||
Reference in New Issue
Block a user