Merge #52 into master from cc_20260121_store_type

Merge branch 'cc_20260126_pingan_wallet' into cc_20260121_store_type

* cc_20260121_store_type: (100 commits squashed)

  - Merge branch 'master' into cc_20251208_visit

  - feat:订单列表

  - feat:订单列表

  - fix:拜访记录导出

  - feat:列表处理

  - Merge branch 'cc_20251208_visit' into cc_20260121_store_type
    
    # Conflicts:
    #	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java

  - feat:标准店接口处理

  - feat:标准店接口处理

  - feat:标准店接口处理

  - feat:标准店接口处理

  - feat:标准店接口处理

  - fix:加盟缴费调整

  - feat:标准店接口处理

  - fix:加盟缴费调整

  - Merge branch 'cc_20260126_pingan_wallet' into cc_20260121_store_type
    
    # Conflicts:
    #	coolstore-partner-model/src/main/java/com/cool/store/dto/wallet/BatchTransferDTO.java
    #	coolstore-partner-model/src/main/java/com/cool/store/request/wallet/BatchTransferRequest.java

  - feat:冲突解决

  - feat:接口处理

  - feat:shopInfo

  - fix:PC缴费信息列表过滤已完成缴费信息

  - fix:测试接口修改

  - Merge branch 'refs/heads/cc_20260126_pingan_wallet' into cc_20260121_store_type

  - fix:测试接口修改

  - feat:接口

  - feat:接口调整

  - feat:注释调整

  - feat:key 调整

  - feat:订单ID

  - feat:日志打印

  - feat:选择标准店型

  - feat:useStandardStore

  - feat:标准店没有缴费阶段

  - feat:标准店没有缴费阶段

  - feat:标准店没有缴费阶段

  - feat:标准店没有缴费阶段

  - feat:阶段调整

  - fix:修复加盟缴费流程流转错误

  - feat:费用类型ID

  - feat:锁释放

  - feat:分账状态

  - fix:加盟签约合同数据补充

  - feat:排序

  - feat:选项单位

  - feat:选项单位

  - feat:选项单位

  - feat:选项单位

  - feat:option_unit

  - feat:option_unit

  - feat:更新调整

  - feat:视频非必填

  - feat:optionUnit

  - fix:转义

  - Merge branch 'master' into cc_20260126_pingan_wallet
    
    # Conflicts:
    #	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java

  - feat:同一配置项下只能设置一个默认选项

  - feat:数量支持小数,新增首次订货字段

  - fix:提交及修改校验合计缴费金额和分账总金额是否相同

  - feat:queryPage

  - feat:defaultQuantity 改为 BigDecimal

  - feat:defaultQuantity 改为 BigDecimal

  - feat:门店预约到店

  - feat:门店预约到店 取消预约

  - feat:门店预约到店 手机号

  - feat:添加原价

  - feat:添加原价

  - feat:添加原价

  - feat:字典表 remark

  - Merge branch 'master' into cc_20260121_store_type
    
    # Conflicts:
    #	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java
    #	coolstore-partner-common/src/main/java/com/cool/store/enums/FileTypeEnum.java
    #	coolstore-partner-model/src/main/java/com/cool/store/vo/dict/DictColumnSimpleVO.java
    #	coolstore-partner-service/src/main/java/com/cool/store/service/ExportRealizeService.java
    #	coolstore-partner-service/src/main/java/com/cool/store/service/ExportService.java
    #	coolstore-partner-service/src/main/java/com/cool/store/service/impl/ExportRealizeServiceImpl.java
    #	coolstore-partner-service/src/main/java/com/cool/store/service/impl/ExportServiceImpl.java
    #	coolstore-partner-web/src/main/java/com/cool/store/controller/webb/ExportController.java

  - feat:字典表 remark

  - feat:服务人员手机号

  - feat:价格计算调整店型优惠价*默认数量 + 原价 *(选择数量-默认数量)

  - fix:补充钱包账单推送新管家流程

  - fix:账单推送钱包支付类型payWay由1改为2

  - feat:同一配置项下只能设置一个默认选项 限制去掉

  - fix:平安钱包分账信息改为非必填

  - feat:同一配置项只能选择一个选项 限制去掉

  - feat:心愿单

  - feat:心愿单

  - feat:心愿单接口调整

  - feat:心愿单接口调整

  - feat:心愿单接口调整

  - feat:批量更新数据

  - feat:查询店型已配置的选项绑定 新增顶部预览图

  - feat:查询店型已配置的选项绑定 新增顶部预览图

  - feat:查询店型已配置的选项绑定 新增顶部预览图

  - feat:配置大类

  - feat:配置大类

  - feat:价格优化

  - feat:阶段审批处理

  - fix:删除设计费-立规

  - feat:配置大项 配置项接口改造

  - feat:配置大项 配置项接口改造

  - feat:handleAudit

  - feat:新增code

  - feat:categoryId

  - feat:心愿单接口更新

  - feat:心愿单接口更新

  - feat:心愿单接口更新

  - feat:心愿单接口更新

  - feat:心愿单接口更新

  - Merge branch 'cc_20260126_pingan_wallet' into cc_20260121_store_type
    
    # Conflicts:
    #	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java

  - Merge branch 'master' into cc_20260121_store_type
    
    # Conflicts:
    #	coolstore-partner-service/src/main/java/com/cool/store/service/impl/SignFranchiseServiceImpl.java

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/52
This commit is contained in:
正新
2026-03-10 14:13:03 +00:00
parent 5c49337e1f
commit 489d72f06f
264 changed files with 13194 additions and 99 deletions

View File

@@ -42,4 +42,17 @@ public class FranchiseFeeDAO {
}
return franchiseFeeMapper.batchUpdateXgjCollectionStatusAndXgjFeesPaid(franchiseFeeStageDateDTOList);
}
public Boolean updatePayType(Long shopId, Integer payType) {
if (shopId == null || payType == null){
return false;
}
Example example = new Example(FranchiseFeeDO.class);
example.createCriteria().andEqualTo("shopId", shopId);
return franchiseFeeMapper.updateByExampleSelective(FranchiseFeeDO.builder().payType(payType).build(), example) > 0;
}
public FranchiseFeeDO selectByShopId(Long shopId) {
return franchiseFeeMapper.selectByShopId(shopId);
}
}

View File

@@ -4,6 +4,7 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.BuildStageDTO;
import com.cool.store.dto.PlatformBuildStageDTO;
import com.cool.store.dto.Preparation.ScheduleDTO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.enums.FranchiseBrandEnum;
@@ -41,11 +42,11 @@ public class ShopStageInfoDAO {
/**
* 初始化店铺阶段信息
* @param lineId
* @param lineInfoDO
* @param shopInfoList
* @return flag =true:表示意向加盟节点完成正常初始化。false:表示意向加盟节点未完成新建分店阶段都为未开始-100。
*/
public Integer initShopStageInfo(Long lineId, List<ShopInfoDO> shopInfoList, Boolean flag) {
public Integer initShopStageInfo(LineInfoDO lineInfoDO, List<ShopInfoDO> shopInfoList, Boolean flag) {
if (CollectionUtils.isEmpty(shopInfoList)) {
return CommonConstants.ZERO;
}
@@ -58,28 +59,27 @@ public class ShopStageInfoDAO {
// 三明治跳过营帐通开通
continue;
}
// TODO: 临时跳过
if (shopSubStageEnum.equals(ShopSubStageEnum.SHOP_STAGE_6)) {
continue;
}
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setLineId(lineId);
shopStageInfo.setLineId(lineInfoDO.getId());
shopStageInfo.setShopId(shopId);
ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum();
shopStageInfo.setShopStage(shopStageEnum.getShopStage());
shopStageInfo.setShopSubStage(shopSubStageEnum.getShopSubStage());
ShopSubStageStatusEnum initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
if (flag) {
initStatus = shopSubStageEnum.getInitStatus();
initStatus = shopSubStageEnum.getInitStatus(lineInfoDO.getUseStandardStore());
}
//标准店和普通店
if (initStatus == null){
continue;
}
shopStageInfo.setShopSubStageStatus(initStatus.getShopSubStageStatus());
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + shopSubStageEnum.getInitStatus().getShopSubStageStatusName());
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + initStatus.getShopSubStageStatusName());
shopStageInfo.setIsTerminated(Boolean.FALSE);
shopStageInfo.setPlanCompleteTime(shopSubStageEnum.getPlanCompleteTime(selectStartDate));
addShopStageList.add(shopStageInfo);
}
}
//发送短信
return shopStageInfoMapper.batchInsert(addShopStageList);
}

View File

@@ -0,0 +1,99 @@
package com.cool.store.dao.config;
import com.cool.store.entity.config.ConfigItemCategoryDO;
import com.cool.store.mapper.config.ConfigItemCategoryMapper;
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
import com.cool.store.vo.config.ConfigItemCategoryBaseInfoVO;
import com.cool.store.vo.config.ConfigItemCategoryVO;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.*;
import java.util.stream.Collectors;
@Repository
@RequiredArgsConstructor
public class ConfigItemCategoryDAO {
private final ConfigItemCategoryMapper configItemCategoryMapper;
public boolean insertSelective(ConfigItemCategoryDO entity) {
return configItemCategoryMapper.insertSelective(entity) > 0;
}
public boolean updateSelective(ConfigItemCategoryDO entity) {
return configItemCategoryMapper.updateByPrimaryKeySelective(entity) > 0;
}
public ConfigItemCategoryDO getById(Long id) {
return configItemCategoryMapper.selectByPrimaryKey(id);
}
public List<ConfigItemCategoryVO> queryByCondition(String categoryName, Integer status) {
return configItemCategoryMapper.queryByCondition(categoryName, status);
}
public List<ConfigItemCategoryBaseInfoVO> queryAllList() {
return configItemCategoryMapper.queryAllActiveList();
}
public Map<String,String> queryAllListMap() {
List<ConfigItemCategoryBaseInfoVO> configItemBaseInfoVOS = configItemCategoryMapper.queryAllActiveList();
if (CollectionUtils.isEmpty(configItemBaseInfoVOS)){
return new HashMap<>();
}
return configItemCategoryMapper.queryAllActiveList().stream()
.filter(v -> StringUtils.isNotBlank(v.getCategoryCode()))
.collect(Collectors.toMap(ConfigItemCategoryBaseInfoVO::getCategoryCode, ConfigItemCategoryBaseInfoVO::getCategoryName, (a, b) -> a));
}
public boolean softDeleteByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return false;
}
ConfigItemCategoryDO update = new ConfigItemCategoryDO();
update.setIsDeleted(1);
Example example = new Example(ConfigItemCategoryDO.class);
example.createCriteria().andIn("id", ids).andEqualTo("isDeleted", 0);
return configItemCategoryMapper.updateByExampleSelective(update, example) > 0;
}
public Map<String,String> nameMap(List<String> codeList) {
if (CollectionUtils.isEmpty(codeList)) {
return new HashMap<>();
}
Example example = new Example(ConfigItemCategoryDO.class);
example.createCriteria().andIn("categoryCode", codeList).andEqualTo("isDeleted", 0);
return configItemCategoryMapper.selectByExample( example).stream()
.filter(v -> StringUtils.isNotBlank(v.getCategoryCode()))
.collect(Collectors.toMap(ConfigItemCategoryDO::getCategoryCode, ConfigItemCategoryDO::getCategoryName, (a, b) -> a));
}
public boolean existsCode(Integer code, Long excludeId) {
if (code == null) {
return false;
}
Example example = new Example(ConfigItemCategoryDO.class);
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", code).andEqualTo("isDeleted", 0);
if (excludeId != null) {
criteria.andNotEqualTo("id", excludeId);
}
return configItemCategoryMapper.selectCountByExample(example) > 0;
}
public boolean existsSortNo(Integer sortNo, Long excludeId) {
if (sortNo == null) {
return false;
}
Example example = new Example(ConfigItemCategoryDO.class);
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", sortNo).andEqualTo("isDeleted", 0);
if (excludeId != null) {
criteria.andNotEqualTo("id", excludeId);
}
return configItemCategoryMapper.selectCountByExample(example) > 0;
}
}

View File

@@ -0,0 +1,107 @@
package com.cool.store.dao.config;
import com.cool.store.entity.config.ConfigItemCategoryDO;
import com.cool.store.entity.config.ConfigItemDO;
import com.cool.store.mapper.config.ConfigItemMapper;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
import com.cool.store.vo.config.ConfigItemVO;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Repository
@RequiredArgsConstructor
public class ConfigItemDAO {
private final ConfigItemMapper configItemMapper;
public boolean insertSelective(ConfigItemDO entity) {
return configItemMapper.insertSelective(entity) > 0;
}
public boolean updateSelective(ConfigItemDO entity) {
return configItemMapper.updateByPrimaryKeySelective(entity) > 0;
}
public ConfigItemDO getById(Long id) {
return configItemMapper.selectByPrimaryKey(id);
}
public List<ConfigItemVO> queryByCondition(String itemName, String itemCode, Long categoryId, Integer status) {
return configItemMapper.queryByCondition(itemName, itemCode, categoryId, status);
}
public Map<String, String> queryAllActiveMap() {
List<ConfigItemBaseInfoVO> configItemBaseInfoVOS = configItemMapper.queryAllActiveList();
if (CollectionUtils.isEmpty(configItemBaseInfoVOS)){
return new HashMap<>();
}
return configItemBaseInfoVOS.stream()
.filter(v -> StringUtils.isNotBlank(v.getItemCode()))
.collect(Collectors.toMap(ConfigItemBaseInfoVO::getItemCode, ConfigItemBaseInfoVO::getItemName, (a, b) -> a));
}
public boolean softDeleteByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return false;
}
ConfigItemDO update = new ConfigItemDO();
update.setIsDeleted(1);
Example example = new Example(ConfigItemDO.class);
example.createCriteria().andIn("id", ids).andEqualTo("isDeleted", 0);
return configItemMapper.updateByExampleSelective(update, example) > 0;
}
public boolean existsItemCode(String code, Long excludeId) {
if (StringUtil.isEmpty(code)) {
return false;
}
Example example = new Example(ConfigItemDO.class);
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", code).andEqualTo("isDeleted", 0);
if (excludeId != null) {
criteria.andNotEqualTo("id", excludeId);
}
return configItemMapper.selectCountByExample(example) > 0;
}
public boolean existsSortNo(Integer sortNo, Long excludeId) {
if (sortNo == null) {
return false;
}
Example example = new Example(ConfigItemDO.class);
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", sortNo).andEqualTo("isDeleted", 0);
if (excludeId != null) {
criteria.andNotEqualTo("id", excludeId);
}
return configItemMapper.selectCountByExample(example) > 0;
}
public int countByCategoryIds(List<Long> categoryIds) {
if (CollectionUtils.isEmpty(categoryIds)) {
return 0;
}
return configItemMapper.countByCategoryIds(categoryIds);
}
public Map<String,String> nameMap(List<String> codeList) {
if (CollectionUtils.isEmpty(codeList)) {
return new HashMap<>();
}
Example example = new Example(ConfigItemDO.class);
example.createCriteria().andIn("itemCode", codeList).andEqualTo("isDeleted", 0);
return configItemMapper.selectByExample( example).stream()
.filter(v -> StringUtils.isNotBlank(v.getItemCode()))
.collect(Collectors.toMap(ConfigItemDO::getItemCode, ConfigItemDO::getItemName, (a, b) -> a));
}
}

View File

@@ -0,0 +1,101 @@
package com.cool.store.dao.config;
import com.cool.store.entity.config.ConfigOptionDO;
import com.cool.store.mapper.config.ConfigOptionMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* 配置选项 DAO
*/
@Repository
@RequiredArgsConstructor
public class ConfigOptionDAO {
private final ConfigOptionMapper configOptionMapper;
public boolean insertSelective(ConfigOptionDO option) {
return configOptionMapper.insertSelective(option) > 0;
}
public boolean updateSelective(ConfigOptionDO option) {
return configOptionMapper.updateByPrimaryKeySelective(option) > 0;
}
public ConfigOptionDO getById(Long id) {
return configOptionMapper.selectByPrimaryKey(id);
}
public boolean deleteByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return false;
}
Example example = new Example(ConfigOptionDO.class);
example.createCriteria().andIn("id", ids);
return configOptionMapper.deleteByExample(example) > 0;
}
public List<ConfigOptionDO> query(String categoryCode, String itemCode, Integer active, String optionName) {
Example example = new Example(ConfigOptionDO.class);
Example.Criteria criteria = example.createCriteria();
if (Objects.nonNull(categoryCode)) {
criteria.andEqualTo("categoryCode", categoryCode);
}
if (Objects.nonNull(itemCode)) {
criteria.andEqualTo("itemCode", itemCode);
}
if (Objects.nonNull(active)) {
criteria.andEqualTo("active", active);
}
if (Objects.nonNull(optionName) && !optionName.trim().isEmpty()) {
criteria.andLike("optionName", "%" + optionName.trim() + "%");
}
example.setOrderByClause("sort_order ASC");
return configOptionMapper.selectByExample(example);
}
public List<ConfigOptionDO> listActiveByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return Collections.emptyList();
}
return configOptionMapper.listActiveByIds(ids);
}
/**
* 校验排序是否已存在(全局唯一,不区分类型/配置项)
* @param sortOrder 排序值
* @param excludeId 排除自身ID新增传 null修改传当前ID
*/
public boolean existsSortOrder(Integer sortOrder, Long excludeId) {
if (sortOrder == null) {
return false;
}
Example example = new Example(ConfigOptionDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("sortOrder", sortOrder);
criteria.andEqualTo("active", 1);
if (excludeId != null) {
criteria.andNotEqualTo("id", excludeId);
}
return configOptionMapper.selectCountByExample(example) > 0;
}
public boolean existsOptionName(String optionName, Long excludeId) {
if (optionName == null || optionName.trim().isEmpty()) {
return false;
}
Example example = new Example(ConfigOptionDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("optionName", optionName.trim());
criteria.andEqualTo("active", 1);
if (excludeId != null) {
criteria.andNotEqualTo("id", excludeId);
}
return configOptionMapper.selectCountByExample(example) > 0;
}
}

View File

@@ -0,0 +1,73 @@
package com.cool.store.dao.fees;
import cn.hutool.core.collection.CollStreamUtil;
import com.cool.store.entity.fees.FeeStandardConfigDO;
import com.cool.store.mapper.fees.FeeStandardConfigMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 加盟费用标准收费额配置DAO
*/
@Repository
@RequiredArgsConstructor
public class FeeStandardConfigDAO {
private final FeeStandardConfigMapper feeStandardConfigMapper;
public FeeStandardConfigDO selectByPrimaryKey(Long id) {
return feeStandardConfigMapper.selectByPrimaryKey(id);
}
public void insertSelective(FeeStandardConfigDO config) {
feeStandardConfigMapper.insertSelective(config);
}
public void updateByPrimaryKeySelective(FeeStandardConfigDO config) {
feeStandardConfigMapper.updateByPrimaryKeySelective(config);
}
public boolean existJoinBrandAndExpenseType(Integer joinBrand, String expenseType, Long excludeId) {
Example example = new Example(FeeStandardConfigDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("joinBrand", joinBrand)
.andEqualTo("expenseType", expenseType);
if (Objects.nonNull(excludeId)) {
criteria.andNotEqualTo("id", excludeId);
}
return feeStandardConfigMapper.selectCountByExample(example) > 0;
}
public List<FeeStandardConfigDO> selectByCondition(Integer joinBrand, String expenseType) {
Example example = new Example(FeeStandardConfigDO.class);
Example.Criteria criteria = example.createCriteria();
if (joinBrand != null) {
criteria.andEqualTo("joinBrand", joinBrand);
}
if (StringUtils.isNotBlank(expenseType)) {
criteria.andEqualTo("expenseType", expenseType.trim());
}
example.setOrderByClause("create_time DESC");
return feeStandardConfigMapper.selectByExample(example);
}
/**
* 根据品牌查询费用标准收费额配置映射
* @param joinBrand 品牌
* @return 费用类型 -> 收费额配置
*/
public Map<String, FeeStandardConfigDO> getStandardConfigMap(Integer joinBrand) {
FeeStandardConfigDO configDO = new FeeStandardConfigDO();
configDO.setJoinBrand(joinBrand);
List<FeeStandardConfigDO> list = feeStandardConfigMapper.select(configDO);
return CollStreamUtil.toMap(list, FeeStandardConfigDO::getExpenseType, v -> v);
}
}

View File

@@ -0,0 +1,97 @@
package com.cool.store.dao.fees;
import com.cool.store.entity.fees.PayeeBankConfigDO;
import com.cool.store.mapper.fees.PayeeBankConfigMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
* 线下收款银行配置DAO
*/
@Repository
@RequiredArgsConstructor
public class PayeeBankConfigDAO {
private final PayeeBankConfigMapper payeeBankConfigMapper;
public void insertSelective(PayeeBankConfigDO config) {
payeeBankConfigMapper.insertSelective(config);
}
public void updateByPrimaryKeySelective(PayeeBankConfigDO config) {
payeeBankConfigMapper.updateByPrimaryKeySelective(config);
}
public PayeeBankConfigDO selectByPrimaryKey(Long id) {
return payeeBankConfigMapper.selectByPrimaryKey(id);
}
public boolean existUniqueKey(Integer joinBrand, Long investDivisionId, Integer payType, Long excludeId) {
Example example = new Example(PayeeBankConfigDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("joinBrand", joinBrand)
.andEqualTo("investDivisionId", investDivisionId)
.andEqualTo("payType", payType);
if (Objects.nonNull(excludeId)) {
criteria.andNotEqualTo("id", excludeId);
}
return payeeBankConfigMapper.selectCountByExample(example) > 0;
}
/**
* 同品牌同支付方式:只能存在“全部(0)”或“分部”其中一种
*/
public boolean existOtherInvestType(Integer joinBrand, Integer payType, Long investDivisionId, Long excludeId) {
Example example = new Example(PayeeBankConfigDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("joinBrand", joinBrand)
.andEqualTo("payType", payType);
if (Long.valueOf(0).equals(investDivisionId)) {
criteria.andNotEqualTo("investDivisionId", 0L);
} else {
criteria.andEqualTo("investDivisionId", 0L);
}
if (Objects.nonNull(excludeId)) {
criteria.andNotEqualTo("id", excludeId);
}
return payeeBankConfigMapper.selectCountByExample(example) > 0;
}
public List<PayeeBankConfigDO> selectByCondition(Integer joinBrand, Long investDivisionId, Integer payType) {
Example example = new Example(PayeeBankConfigDO.class);
Example.Criteria criteria = example.createCriteria();
if (joinBrand != null) {
criteria.andEqualTo("joinBrand", joinBrand);
}
if (investDivisionId != null) {
criteria.andEqualTo("investDivisionId", investDivisionId);
}
if (payType != null) {
criteria.andEqualTo("payType", payType);
}
example.setOrderByClause("create_time DESC");
return payeeBankConfigMapper.selectByExample(example);
}
/**
* 根据加盟品牌、加盟分部、支付方式查询配置
* @param joinBrand 加盟品牌
* @param investDivisionId 加盟分部
* @param payType 支付方式
* @return 配置
*/
public PayeeBankConfigDO getByUniqueKey(Integer joinBrand, Long investDivisionId, Integer payType) {
Example example = new Example(PayeeBankConfigDO.class);
example.createCriteria()
.andEqualTo("joinBrand", joinBrand)
.andIn("investDivisionId", Arrays.asList(investDivisionId, 0L))
.andEqualTo("payType", payType);
return payeeBankConfigMapper.selectOneByExample(example);
}
}

View File

@@ -0,0 +1,63 @@
package com.cool.store.dao.fees;
import com.cool.store.entity.fees.ShopAllocationInfoDO;
import com.cool.store.enums.fees.AllocationPayStatusEnum;
import com.cool.store.mapper.fees.ShopAllocationInfoMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Objects;
/**
* <p>
* 门店平安钱包分账信息DAO
* </p>
*
* @author wangff
* @since 2026/1/29
*/
@Repository
@RequiredArgsConstructor
public class ShopAllocationInfoDAO {
private final ShopAllocationInfoMapper shopAllocationInfoMapper;
public List<ShopAllocationInfoDO> getByShopId(Long shopId) {
ShopAllocationInfoDO info = new ShopAllocationInfoDO();
info.setShopId(shopId);
return shopAllocationInfoMapper.select(info);
}
/**
* 批量新增
*/
public void insertBatch(List<ShopAllocationInfoDO> list) {
if (CollectionUtils.isEmpty(list)) {
return;
}
shopAllocationInfoMapper.insertBatch(list);
}
/**
* 批量更新
*/
public void updateBatch(List<ShopAllocationInfoDO> list) {
if (CollectionUtils.isEmpty(list)) {
return;
}
shopAllocationInfoMapper.updateBatch(list);
}
public void insertOrUpdateBatch(List<ShopAllocationInfoDO> list) {
if (CollectionUtils.isEmpty(list)) {
return;
}
for (ShopAllocationInfoDO shopAllocationInfoDO : list) {
if (Objects.isNull(shopAllocationInfoDO.getStatus())) {
shopAllocationInfoDO.setStatus(AllocationPayStatusEnum.PAYING.getStatus());
}
}
shopAllocationInfoMapper.insertOrUpdateBatch(list);
}
}

View File

@@ -0,0 +1,90 @@
package com.cool.store.dao.fees;
import cn.hutool.core.collection.CollStreamUtil;
import com.cool.store.entity.fees.WalletAllocationCompanyDO;
import com.cool.store.mapper.fees.WalletAllocationCompanyMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* 平安钱包分账公司配置DAO
*
* @author system
*/
@Repository
@RequiredArgsConstructor
public class WalletAllocationCompanyDAO {
private final WalletAllocationCompanyMapper walletAllocationCompanyMapper;
public void insertSelective(WalletAllocationCompanyDO company) {
walletAllocationCompanyMapper.insertSelective(company);
}
/**
* 批量新增
*/
public void insertBatch(List<WalletAllocationCompanyDO> list) {
if (CollectionUtils.isNotEmpty(list)) {
walletAllocationCompanyMapper.insertBatch(list);
}
}
public void updateByPrimaryKeySelective(WalletAllocationCompanyDO company) {
walletAllocationCompanyMapper.updateByPrimaryKeySelective(company);
}
public WalletAllocationCompanyDO selectByPrimaryKey(Long id) {
return walletAllocationCompanyMapper.selectByPrimaryKey(id);
}
public void deleteByPrimaryKey(Long id) {
walletAllocationCompanyMapper.deleteByPrimaryKey(id);
}
/**
* 根据分账配置id查询公司列表
*/
public List<WalletAllocationCompanyDO> selectByConfigId(Long configId) {
Example example = new Example(WalletAllocationCompanyDO.class);
example.createCriteria().andEqualTo("configId", configId);
return walletAllocationCompanyMapper.selectByExample(example);
}
/**
* 根据配置id列表查询收款公司映射
*/
public Map<Long, List<WalletAllocationCompanyDO>> selectGroupByConfigIds(List<Long> configIds) {
if (CollectionUtils.isEmpty(configIds)) {
return Collections.emptyMap();
}
Example example = new Example(WalletAllocationCompanyDO.class);
example.createCriteria().andIn("configId", configIds);
List<WalletAllocationCompanyDO> list = walletAllocationCompanyMapper.selectByExample(example);
return CollStreamUtil.groupByKey(list, WalletAllocationCompanyDO::getConfigId);
}
/**
* 根据收款公司code查询用于分页查询条件
*/
public List<WalletAllocationCompanyDO> selectByPayeeCode(String payeeCode) {
Example example = new Example(WalletAllocationCompanyDO.class);
example.createCriteria().andEqualTo("payeeCode", payeeCode);
return walletAllocationCompanyMapper.selectByExample(example);
}
/**
* 根据配置id删除
*/
public void deleteByConfigId(Long configId) {
WalletAllocationCompanyDO companyDO = new WalletAllocationCompanyDO();
companyDO.setConfigId(configId);
walletAllocationCompanyMapper.delete(companyDO);
}
}

View File

@@ -0,0 +1,106 @@
package com.cool.store.dao.fees;
import com.cool.store.entity.fees.WalletAllocationConfigDO;
import com.cool.store.mapper.fees.WalletAllocationConfigMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
* 平安钱包分账配置DAO
*
* @author system
*/
@Repository
@RequiredArgsConstructor
public class WalletAllocationConfigDAO {
private final WalletAllocationConfigMapper walletAllocationConfigMapper;
public void insertSelective(WalletAllocationConfigDO config) {
walletAllocationConfigMapper.insertSelective(config);
}
public void updateByPrimaryKeySelective(WalletAllocationConfigDO config) {
walletAllocationConfigMapper.updateByPrimaryKeySelective(config);
}
public WalletAllocationConfigDO selectByPrimaryKey(Long id) {
return walletAllocationConfigMapper.selectByPrimaryKey(id);
}
/**
* 根据加盟品牌、招商分部、费用类型查询
*/
public Boolean existUniqueKey(Integer joinBrand, Long investDivisionId, String expenseType, Long excludeId) {
Example example = new Example(WalletAllocationConfigDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("joinBrand", joinBrand)
.andEqualTo("investDivisionId", investDivisionId)
.andEqualTo("expenseType", expenseType);
if (Objects.nonNull(excludeId)) {
criteria.andNotEqualTo("id", excludeId);
}
return walletAllocationConfigMapper.selectCountByExample(example) > 0;
}
/**
* 根据加盟品牌、招商分部查询
* @param joinBrand 家门品牌
* @param investDivisionId 招商分部id
* @return 配置列表
*/
public List<WalletAllocationConfigDO> selectByBrandAndInvest(Integer joinBrand, Long investDivisionId) {
Example example = new Example(WalletAllocationConfigDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("joinBrand", joinBrand)
.andIn("investDivisionId", Arrays.asList(investDivisionId, 0L));
return walletAllocationConfigMapper.selectByExample(example);
}
/**
* 分页查询
*/
public List<WalletAllocationConfigDO> selectByCondition(Integer joinBrand, Long investDivisionId, Integer expenseType, List<Long> configIds) {
Example example = new Example(WalletAllocationConfigDO.class);
Example.Criteria criteria = example.createCriteria();
if (joinBrand != null) {
criteria.andEqualTo("joinBrand", joinBrand);
}
if (investDivisionId != null) {
criteria.andEqualTo("investDivisionId", investDivisionId);
}
if (expenseType != null) {
criteria.andEqualTo("expenseType", expenseType);
}
if (CollectionUtils.isNotEmpty(configIds)) {
criteria.andIn("id", configIds);
}
example.setOrderByClause("create_time DESC");
return walletAllocationConfigMapper.selectByExample(example);
}
/**
* 是否存在其他分部类型
*/
public boolean existOtherInvestType(Integer joinBrand, String expenseType, Long investDivisionId, Long excludeId) {
Example example = new Example(WalletAllocationConfigDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("joinBrand", joinBrand)
.andEqualTo("expenseType", expenseType);
if (Long.valueOf(0).equals(investDivisionId)) {
criteria.andNotEqualTo("investDivisionId", 0);
} else {
criteria.andEqualTo("investDivisionId", 0);
}
if (Objects.nonNull(excludeId)) {
criteria.andNotEqualTo("id", excludeId);
}
return walletAllocationConfigMapper.selectCountByExample(example) > 0;
}
}

View File

@@ -0,0 +1,128 @@
package com.cool.store.dao.fees;
import com.cool.store.entity.fees.WalletPayInfoDO;
import com.cool.store.enums.fees.AllocationPayStatusEnum;
import com.cool.store.mapper.fees.WalletPayInfoMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Objects;
/**
* <p>
* 钱包加盟缴费信息DAO
* </p>
*
* @author wangff
* @since 2026/1/30
*/
@Repository
@RequiredArgsConstructor
public class WalletPayInfoDAO {
private final WalletPayInfoMapper walletPayInfoMapper;
/**
* 是否存在缴费信息
* @param shopId 门店id
* @return 是否存在
*/
public boolean existPayInfo(Long shopId) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria().andEqualTo("shopId", shopId);
return walletPayInfoMapper.selectCountByExample(example) > 0;
}
/**
* 批量新增
*/
public void insertBatch(List<WalletPayInfoDO> list) {
if (CollectionUtils.isEmpty(list)) {
return;
}
walletPayInfoMapper.insertBatch(list);
}
/**
* 根据payNo编辑
*/
public void updateByPayNo(WalletPayInfoDO walletPayInfoDO) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria().andEqualTo("payNo", walletPayInfoDO.getPayNo());
walletPayInfoMapper.updateByExampleSelective(walletPayInfoDO, example);
}
/**
* 根据门店id查询
*/
public List<WalletPayInfoDO> getByShopId(Long shopId, String module, Integer payStatus) {
Example example = new Example(WalletPayInfoDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("shopId", shopId)
.andEqualTo("module", module);
if (Objects.nonNull(payStatus)) {
criteria.andEqualTo("payStatus", payStatus);
}
example.setOrderByClause("create_time DESC");
return walletPayInfoMapper.selectByExample(example);
}
/**
* 根据门店查询已支付
*/
public List<WalletPayInfoDO> getPaidByShopId(Long shopId, String module) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria()
.andEqualTo("shopId", shopId)
.andEqualTo("module", module)
.andEqualTo("payStatus", AllocationPayStatusEnum.PAID.getStatus());
example.setOrderByClause("create_time ASC");
return walletPayInfoMapper.selectByExample(example);
}
public WalletPayInfoDO getById(Long id) {
return walletPayInfoMapper.selectByPrimaryKey(id);
}
/**
* 根据付款单号查询
*/
public WalletPayInfoDO getByPayNo(String payNo) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria().andEqualTo("payNo", payNo);
return walletPayInfoMapper.selectOneByExample(example);
}
public List<WalletPayInfoDO> getByPayNoList(List<String> payNoList) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria().andIn("payNo", payNoList);
return walletPayInfoMapper.selectByExample(example);
}
public void updateByPrimaryKeySelective(WalletPayInfoDO walletPayInfoDO) {
walletPayInfoMapper.updateByPrimaryKeySelective(walletPayInfoDO);
}
public boolean updateBatchByPayNo(List<WalletPayInfoDO> list) {
if (CollectionUtils.isEmpty(list)) {
return false;
}
return walletPayInfoMapper.updateBatchByPayNo(list) > 0;
}
/**
* 根据付款单号修改认领状态
* @param payNo 付款单号
* @param claimStatus 认领状态 0未认领1已认领
* @return 是否成功
*/
public void updateClaimStatusByPayNo(String payNo, Integer claimStatus) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria().andEqualTo("payNo", payNo);
WalletPayInfoDO walletPayInfoDO = new WalletPayInfoDO();
walletPayInfoDO.setClaimStatus(claimStatus);
walletPayInfoMapper.updateByExampleSelective(walletPayInfoDO, example);
}
}

View File

@@ -0,0 +1,48 @@
package com.cool.store.dao.modify;
import com.cool.store.entity.modify.ModifyRecordDO;
import com.cool.store.enums.BusinessModuleEnum;
import com.cool.store.mapper.modify.ModifyRecordMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
/**
* 业务修改记录DAO
*
* @author system
*/
@Repository
@RequiredArgsConstructor
public class ModifyRecordDAO {
private final ModifyRecordMapper modifyRecordMapper;
/**
* 新增修改记录
* @param module 业务模块
* @param businessId 业务id
* @param updateUserId 更新人id
*/
public void insertRecord(BusinessModuleEnum module, Long businessId, String updateUserId) {
ModifyRecordDO modifyRecord = new ModifyRecordDO(null, module.getCode(), businessId, updateUserId, null);
modifyRecordMapper.insertSelective(modifyRecord);
}
/**
* 根据模块及业务id查询
* @param module 模块code
* @param businessId 业务id
* @return 记录列表
*/
public List<ModifyRecordDO> getListByBusinessId(String module, Long businessId) {
Example example = new Example(ModifyRecordDO.class);
example.createCriteria()
.andEqualTo("module", module)
.andEqualTo("businessId", businessId);
example.setOrderByClause("update_time desc");
return modifyRecordMapper.selectByExample(example);
}
}

View File

@@ -0,0 +1,55 @@
package com.cool.store.dao.order;
import com.cool.store.entity.order.PreAllocationRecordDO;
import com.cool.store.mapper.order.PreAllocationRecordMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@RequiredArgsConstructor
public class PreAllocationRecordDAO {
private final PreAllocationRecordMapper preAllocationRecordMapper;
public boolean insertSelective(PreAllocationRecordDO record) {
return preAllocationRecordMapper.insertSelective(record) > 0;
}
public PreAllocationRecordDO getById(Long id) {
return preAllocationRecordMapper.getById(id);
}
public List<PreAllocationRecordDO> queryPageByOrderId(Long orderId) {
return preAllocationRecordMapper.queryPageByOrderId(orderId);
}
public List<PreAllocationRecordDO> queryPageByShopId(Long shopId) {
return preAllocationRecordMapper.queryPageByShopId(shopId);
}
public List<PreAllocationRecordDO> queryPageByPayNo(String payNo) {
return preAllocationRecordMapper.queryPageByPayNo(payNo);
}
public boolean updateStatus(Long id, Integer status) {
return preAllocationRecordMapper.updateStatus(id, status) > 0;
}
public boolean deleteByShopId(Long shopId) {
return preAllocationRecordMapper.deleteByShopId(shopId) > 0;
}
public boolean insertBatch(List<PreAllocationRecordDO> list) {
return preAllocationRecordMapper.insertBatch(list) > 0;
}
public boolean updateBatch(List<PreAllocationRecordDO> list) {
return preAllocationRecordMapper.updateBatch(list) > 0;
}
public boolean updateByOrderId(Long orderId) {
return preAllocationRecordMapper.updateByOrderId(orderId) > 0;
}
}

View File

@@ -0,0 +1,73 @@
package com.cool.store.dao.order;
import com.cool.store.entity.order.StoreOrderDO;
import com.cool.store.mapper.order.StoreOrderMapper;
import com.cool.store.request.order.PCStoreOrderQueryRequest;
import com.cool.store.vo.order.PCStoreOrderListVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@RequiredArgsConstructor
public class StoreOrderDAO {
private final StoreOrderMapper storeOrderMapper;
public boolean insertSelective(StoreOrderDO order) {
return storeOrderMapper.insertSelective(order) > 0;
}
public StoreOrderDO getById(Long id) {
return storeOrderMapper.getById(id);
}
public List<StoreOrderDO> queryPage(Long shopId, Integer status) {
return storeOrderMapper.queryPage(shopId, status);
}
public List<StoreOrderDO> queryPageByLineId(Long lineId, Integer status) {
return storeOrderMapper.queryPageByLineId(lineId, status);
}
public List<PCStoreOrderListVO> queryPCPage(PCStoreOrderQueryRequest request) {
return storeOrderMapper.queryPCPage(request);
}
public Long count(PCStoreOrderQueryRequest request) {
return storeOrderMapper.count(request);
}
public boolean updateSelective(StoreOrderDO order) {
return storeOrderMapper.updateByPrimaryKeySelective(order) > 0;
}
public boolean existsUnfinishedOrder(Long shopId, List<Integer> statuses) {
if (shopId == null || statuses == null || statuses.isEmpty()) {
return false;
}
return storeOrderMapper.countByShopIdAndStatusIn(shopId, statuses) > 0;
}
public boolean existsPaidOrder(Long shopId, Integer status) {
if (shopId == null || status == null) {
return false;
}
return storeOrderMapper.countByShopIdAndStatus(shopId, status) > 0;
}
public StoreOrderDO getLatestByShopIdAndStatus(Long shopId, Integer status) {
if (shopId == null || status == null) {
return null;
}
return storeOrderMapper.getLatestDraftByShopId(shopId, status);
}
public StoreOrderDO getLatestOrderByShopId(Long shopId) {
if (shopId == null ) {
return null;
}
return storeOrderMapper.getLatestOrderByShopId(shopId);
}
}

View File

@@ -0,0 +1,54 @@
package com.cool.store.dao.order;
import com.cool.store.entity.order.StoreOrderOptionSnapshotDO;
import com.cool.store.mapper.order.StoreOrderOptionSnapshotMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Collections;
import java.util.List;
@Repository
@RequiredArgsConstructor
public class StoreOrderOptionSnapshotDAO {
private final StoreOrderOptionSnapshotMapper mapper;
public boolean insertBatch(List<StoreOrderOptionSnapshotDO> list) {
if (CollectionUtils.isEmpty(list)) {
return false;
}
return mapper.insertBatch(list) > 0;
}
public List<StoreOrderOptionSnapshotDO> listByOrderId(Long orderId) {
if (orderId == null) {
return Collections.emptyList();
}
return mapper.listByOrderId(orderId);
}
public boolean deleteByOrderId(Long orderId) {
if (orderId == null) {
return false;
}
return mapper.deleteByOrderId(orderId) > 0;
}
public boolean updateSelective(StoreOrderOptionSnapshotDO snapshotDO) {
if (snapshotDO == null || snapshotDO.getId() == null) {
return false;
}
return mapper.updateByPrimaryKeySelective(snapshotDO) > 0;
}
public void batchUpdateQuantityAndAmount(@Param("list") List<StoreOrderOptionSnapshotDO> list){
if (CollectionUtils.isEmpty(list)){
return;
}
mapper.batchUpdateQuantityAndAmount(list);
}
}

View File

@@ -0,0 +1,53 @@
package com.cool.store.dao.order;
import com.cool.store.entity.order.StoreWishlistDO;
import com.cool.store.mapper.order.StoreWishlistMapper;
import com.cool.store.vo.order.MiniStoreWishlistListVO;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import java.util.Collections;
import java.util.List;
@Repository
@RequiredArgsConstructor
public class StoreWishlistDAO {
private final StoreWishlistMapper mapper;
public boolean insertBatch(List<StoreWishlistDO> list) {
if (CollectionUtils.isEmpty(list)) {
return false;
}
return mapper.insertBatch(list) > 0;
}
public boolean softDeleteByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
if (lineId == null || storeTypeId == null || versionNo == null) {
return false;
}
return mapper.softDeleteByLineIdAndStoreTypeAndVersion(lineId, storeTypeId, versionNo) > 0;
}
public StoreWishlistDO getById(Long id) {
if (id == null) {
return null;
}
return mapper.getById(id);
}
public List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
if (lineId == null || storeTypeId == null || versionNo == null) {
return Collections.emptyList();
}
return mapper.listByLineIdAndStoreTypeAndVersion(lineId, storeTypeId, versionNo);
}
public List<MiniStoreWishlistListVO> listByLineId(Long lineId, Long storeTypeId) {
if (lineId == null) {
return Collections.emptyList();
}
return mapper.listByLineId(lineId, storeTypeId);
}
}

View File

@@ -0,0 +1,119 @@
package com.cool.store.dao.store;
import com.cool.store.entity.store.StoreTypeDO;
import com.cool.store.mapper.store.StoreTypeMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.ArrayList;
import java.util.List;
/**
* 店型 DAO
*/
@Repository
@RequiredArgsConstructor
public class StoreTypeDAO {
private final StoreTypeMapper storeTypeMapper;
/** 新增 */
public boolean insertSelective(StoreTypeDO storeTypeDO) {
return storeTypeMapper.insertSelective(storeTypeDO) > 0;
}
/** 编辑 */
public boolean updateSelective(StoreTypeDO storeTypeDO) {
return storeTypeMapper.updateByPrimaryKeySelective(storeTypeDO) > 0;
}
/** 根据主键查询 */
public StoreTypeDO getById(Long id) {
return storeTypeMapper.selectByPrimaryKey(id);
}
/** 根据编码查询 */
public StoreTypeDO getByCode(String code) {
return storeTypeMapper.selectOne(StoreTypeDO.builder().storeTypeCode(code).build());
}
/** 批量删除(物理删除,谨慎使用) */
public boolean deleteByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return false;
}
Example example = new Example(StoreTypeDO.class);
example.createCriteria().andIn("id", ids);
return storeTypeMapper.deleteByExample(example) > 0;
}
public List<StoreTypeDO> selectByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
}
Example example = new Example(StoreTypeDO.class);
example.createCriteria().andIn("id", ids);
return storeTypeMapper.selectByExample(example);
}
/**
* 软删除deleted=true
*/
public boolean softDeleteByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return false;
}
StoreTypeDO update = new StoreTypeDO();
update.setDeleted(true);
Example example = new Example(StoreTypeDO.class);
example.createCriteria().andIn("id", ids);
return storeTypeMapper.updateByExampleSelective(update, example) > 0;
}
/**
* 启用/停用
*/
public boolean updateActiveById(Long id, Boolean active) {
if (id == null) {
return false;
}
StoreTypeDO update = new StoreTypeDO();
update.setId(id);
update.setActive(active);
return storeTypeMapper.updateByPrimaryKeySelective(update) > 0;
}
/**
* 分页/条件查询
* @param keyword 名称/编码模糊
* @param active 是否启用
* @param brand 品牌精准
*/
public List<StoreTypeDO> queryByCondition(String keyword, Boolean active, String brand) {
return storeTypeMapper.queryByCondition(keyword, active, brand);
}
/**
* 根据门店类型查询启用的店型
*/
public List<StoreTypeDO> listActiveByStoreType(Integer storeType) {
return storeTypeMapper.listByStoreType(storeType);
}
/**
* 校验排序是否已存在(全局唯一)
*/
public boolean existsSortOrder(Integer sortOrder, Long excludeId) {
if (sortOrder == null) {
return false;
}
Example example = new Example(StoreTypeDO.class);
Example.Criteria criteria = example.createCriteria().andEqualTo("sortOrder", sortOrder);
criteria.andEqualTo("deleted", 1);
if (excludeId != null) {
criteria.andNotEqualTo("id", excludeId);
}
return storeTypeMapper.selectCountByExample(example) > 0;
}
}

View File

@@ -0,0 +1,69 @@
package com.cool.store.dao.store;
import com.cool.store.entity.CloseStoreAuditRecordDO;
import com.cool.store.entity.store.StoreTypeDO;
import com.cool.store.entity.store.StoreTypeOptionDO;
import com.cool.store.enums.close.CloseStoreAuditStatusEnum;
import com.cool.store.mapper.store.StoreTypeOptionMapper;
import io.swagger.models.auth.In;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Objects;
/**
* 店型-选项 DAO
*/
@Repository
@RequiredArgsConstructor
public class StoreTypeOptionDAO {
private final StoreTypeOptionMapper mapper;
public boolean insertBatchSelective(List<StoreTypeOptionDO> list) {
if (CollectionUtils.isEmpty(list)) {
return false;
}
return mapper.insertBatch(list) > 0;
}
public boolean deleteByStoreTypeId(Long storeTypeId) {
return mapper.delete(StoreTypeOptionDO.builder().storeTypeId(storeTypeId).build()) > 0;
}
public Integer softDeleteByStoreTypeId(List<Long> storeTypeIds){
Example example = new Example(StoreTypeOptionDO.class);
StoreTypeOptionDO update = new StoreTypeOptionDO();
update.setVisible(1);
example.createCriteria()
.andIn("storeTypeId", storeTypeIds);
return mapper.updateByExampleSelective(update,example);
}
public List<StoreTypeOptionDO> listByStoreTypeId(Long storeTypeId) {
return mapper.select(StoreTypeOptionDO.builder().storeTypeId(storeTypeId).build());
}
public List<StoreTypeOptionDO> query(Long storeTypeId, String itemCode) {
Example example = new Example(StoreTypeOptionDO.class);
Example.Criteria criteria = example.createCriteria();
if (Objects.nonNull(storeTypeId)) {
criteria.andEqualTo("storeTypeId", storeTypeId);
}
if (Objects.nonNull(itemCode)) {
criteria.andEqualTo("itemCode", itemCode);
}
return mapper.selectByExample(example);
}
public int countByOptionId(Long optionId) {
if (optionId == null) {
return 0;
}
Example example = new Example(StoreTypeOptionDO.class);
example.createCriteria().andEqualTo("optionId", optionId).andEqualTo("visible",0);
return mapper.selectCountByExample(example);
}
}

View File

@@ -0,0 +1,49 @@
package com.cool.store.dao.visit;
import com.cool.store.entity.visit.StoreVisitReservationDO;
import com.cool.store.mapper.visit.StoreVisitReservationMapper;
import com.cool.store.request.visit.StoreVisitReservationAdminQueryRequest;
import com.cool.store.vo.visit.StoreVisitReservationVO;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@Repository
@RequiredArgsConstructor
public class StoreVisitReservationDAO {
private final StoreVisitReservationMapper storeVisitReservationMapper;
public Boolean insertSelective(StoreVisitReservationDO reservationDO) {
return storeVisitReservationMapper.insertSelective(reservationDO) > 0;
}
public Boolean updateSelective(StoreVisitReservationDO reservationDO) {
return storeVisitReservationMapper.updateByPrimaryKeySelective(reservationDO) > 0;
}
public StoreVisitReservationDO getById(Long id) {
return storeVisitReservationMapper.selectByPrimaryKey(id);
}
public List<StoreVisitReservationDO> listByMobile(String mobile,Integer status) {
Example example = new Example(StoreVisitReservationDO.class);
Example.Criteria criteria = example.createCriteria()
.andEqualTo("deleted", 0);
if (StringUtils.isNotBlank(mobile)) {
criteria.andEqualTo("mobile", mobile);
}
if (status!=null){
criteria.andEqualTo("status",status);
}
example.setOrderByClause("create_time DESC");
return storeVisitReservationMapper.selectByExample(example);
}
public List<StoreVisitReservationVO> adminPage(StoreVisitReservationAdminQueryRequest request) {
return storeVisitReservationMapper.adminPage(request);
}
}

View File

@@ -0,0 +1,59 @@
package com.cool.store.dao.wallet;
import com.cool.store.entity.wallet.WalletTradeDO;
import com.cool.store.mapper.wallet.WalletTradeMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
/**
* <p>
* 钱包交易单DAO
* </p>
*
* @author wangff
* @since 2026/2/4
*/
@Repository
@RequiredArgsConstructor
public class WalletTradeDAO {
private final WalletTradeMapper walletTradeMapper;
public void insertSelective(WalletTradeDO walletTradeDO) {
walletTradeMapper.insertSelective(walletTradeDO);
}
public void insertBatch(List<WalletTradeDO> list) {
if (CollectionUtils.isEmpty(list)) {
return;
}
walletTradeMapper.insertBatch(list);
}
public WalletTradeDO getByPayNo(String payNo) {
Example example = new Example(WalletTradeDO.class);
example.createCriteria().andEqualTo("payNo", payNo);
return walletTradeMapper.selectOneByExample(example);
}
public void updateByPrimaryKeySelective(WalletTradeDO walletTradeDO) {
walletTradeMapper.updateByPrimaryKeySelective(walletTradeDO);
}
public boolean updateByPayNo(WalletTradeDO record) {
if (record == null || record.getPayNo() == null) {
return false;
}
return walletTradeMapper.updateByPayNo(record) > 0;
}
public boolean updateBatchByPayNo(List<WalletTradeDO> list) {
if (CollectionUtils.isEmpty(list)) {
return false;
}
return walletTradeMapper.updateBatchByPayNo(list) > 0;
}
}

View File

@@ -0,0 +1,18 @@
package com.cool.store.mapper.config;
import com.cool.store.entity.config.ConfigItemCategoryDO;
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
import com.cool.store.vo.config.ConfigItemCategoryBaseInfoVO;
import com.cool.store.vo.config.ConfigItemCategoryVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface ConfigItemCategoryMapper extends Mapper<ConfigItemCategoryDO> {
List<ConfigItemCategoryVO> queryByCondition(@Param("categoryName") String categoryName,
@Param("status") Integer status);
List<ConfigItemCategoryBaseInfoVO> queryAllActiveList();
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.mapper.config;
import com.cool.store.entity.config.ConfigItemDO;
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
import com.cool.store.vo.config.ConfigItemCategoryBaseInfoVO;
import com.cool.store.vo.config.ConfigItemVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface ConfigItemMapper extends Mapper<ConfigItemDO> {
List<ConfigItemVO> queryByCondition(@Param("itemName") String itemName,
@Param("itemCode") String itemCode,
@Param("categoryId") Long categoryId,
@Param("status") Integer status);
List<ConfigItemBaseInfoVO> queryAllActiveList();
int countByCategoryIds(@Param("categoryIds") List<Long> categoryIds);
}

View File

@@ -0,0 +1,12 @@
package com.cool.store.mapper.config;
import com.cool.store.entity.config.ConfigOptionDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface ConfigOptionMapper extends Mapper<ConfigOptionDO> {
List<ConfigOptionDO> listActiveByIds(@Param("ids") List<Long> ids);
}

View File

@@ -0,0 +1,7 @@
package com.cool.store.mapper.fees;
import com.cool.store.entity.fees.FeeStandardConfigDO;
import tk.mybatis.mapper.common.Mapper;
public interface FeeStandardConfigMapper extends Mapper<FeeStandardConfigDO> {
}

View File

@@ -0,0 +1,7 @@
package com.cool.store.mapper.fees;
import com.cool.store.entity.fees.PayeeBankConfigDO;
import tk.mybatis.mapper.common.Mapper;
public interface PayeeBankConfigMapper extends Mapper<PayeeBankConfigDO> {
}

View File

@@ -0,0 +1,20 @@
package com.cool.store.mapper.fees;
import com.cool.store.entity.fees.ShopAllocationInfoDO;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface ShopAllocationInfoMapper extends Mapper<ShopAllocationInfoDO> {
/**
* 批量新增
*/
void insertBatch(List<ShopAllocationInfoDO> list);
/**
* 批量更新
*/
void updateBatch(List<ShopAllocationInfoDO> list);
void insertOrUpdateBatch(List<ShopAllocationInfoDO> list);
}

View File

@@ -0,0 +1,14 @@
package com.cool.store.mapper.fees;
import com.cool.store.entity.fees.WalletAllocationCompanyDO;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface WalletAllocationCompanyMapper extends Mapper<WalletAllocationCompanyDO> {
/**
* 批量新增
*/
void insertBatch(List<WalletAllocationCompanyDO> list);
}

View File

@@ -0,0 +1,7 @@
package com.cool.store.mapper.fees;
import com.cool.store.entity.fees.WalletAllocationConfigDO;
import tk.mybatis.mapper.common.Mapper;
public interface WalletAllocationConfigMapper extends Mapper<WalletAllocationConfigDO> {
}

View File

@@ -0,0 +1,15 @@
package com.cool.store.mapper.fees;
import com.cool.store.entity.fees.WalletPayInfoDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface WalletPayInfoMapper extends Mapper<WalletPayInfoDO> {
void insertBatch(List<WalletPayInfoDO> list);
int updateByPayNo(WalletPayInfoDO record);
int updateBatchByPayNo(@Param("list") List<WalletPayInfoDO> list);
}

View File

@@ -0,0 +1,7 @@
package com.cool.store.mapper.modify;
import com.cool.store.entity.modify.ModifyRecordDO;
import tk.mybatis.mapper.common.Mapper;
public interface ModifyRecordMapper extends Mapper<ModifyRecordDO> {
}

View File

@@ -0,0 +1,28 @@
package com.cool.store.mapper.order;
import com.cool.store.entity.order.PreAllocationRecordDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface PreAllocationRecordMapper extends Mapper<PreAllocationRecordDO> {
PreAllocationRecordDO getById(@Param("id") Long id);
List<PreAllocationRecordDO> queryPageByOrderId(@Param("orderId") Long orderId);
List<PreAllocationRecordDO> queryPageByShopId(@Param("shopId") Long shopId);
List<PreAllocationRecordDO> queryPageByPayNo(@Param("payNo") String payNo);
int updateStatus(@Param("id") Long id, @Param("status") Integer status);
int deleteByShopId(@Param("shopId") Long shopId);
int insertBatch(@Param("list") List<PreAllocationRecordDO> list);
int updateBatch(@Param("list") List<PreAllocationRecordDO> list);
int updateByOrderId(Long orderId);
}

View File

@@ -0,0 +1,41 @@
package com.cool.store.mapper.order;
import com.cool.store.entity.order.StoreOrderDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import com.cool.store.request.order.PCStoreOrderQueryRequest;
import com.cool.store.vo.order.PCStoreOrderListVO;
import java.util.List;
public interface StoreOrderMapper extends Mapper<StoreOrderDO> {
List<StoreOrderDO> queryPage(@Param("shopId") Long shopId,
@Param("status") Integer status);
List<PCStoreOrderListVO> queryPCPage(PCStoreOrderQueryRequest request);
Long count(PCStoreOrderQueryRequest request);
List<StoreOrderDO> queryPageByLineId(@Param("lineId") Long lineId,
@Param("status") Integer status);
StoreOrderDO getById(@Param("id") Long id);
StoreOrderDO getLatestDraftByShopId(@Param("shopId") Long shopId,
@Param("status") Integer status);
/**
* 获取当前门店 最新的订单 除了已关闭的
* @param shopId
* @return
*/
StoreOrderDO getLatestOrderByShopId(@Param("shopId") Long shopId);
int countByShopIdAndStatusIn(@Param("shopId") Long shopId,
@Param("statuses") List<Integer> statuses);
int countByShopIdAndStatus(@Param("shopId") Long shopId,
@Param("status") Integer status);
}

View File

@@ -0,0 +1,18 @@
package com.cool.store.mapper.order;
import com.cool.store.entity.order.StoreOrderOptionSnapshotDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface StoreOrderOptionSnapshotMapper extends Mapper<StoreOrderOptionSnapshotDO> {
int insertBatch(@Param("list") List<StoreOrderOptionSnapshotDO> list);
List<StoreOrderOptionSnapshotDO> listByOrderId(@Param("orderId") Long orderId);
int deleteByOrderId(@Param("orderId") Long orderId);
void batchUpdateQuantityAndAmount(@Param("list") List<StoreOrderOptionSnapshotDO> list);
}

View File

@@ -0,0 +1,26 @@
package com.cool.store.mapper.order;
import com.cool.store.entity.order.StoreWishlistDO;
import com.cool.store.vo.order.MiniStoreWishlistListVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface StoreWishlistMapper extends Mapper<StoreWishlistDO> {
int insertBatch(@Param("list") List<StoreWishlistDO> list);
int softDeleteByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
@Param("storeTypeId") Long storeTypeId,
@Param("versionNo") String versionNo);
StoreWishlistDO getById(@Param("id") Long id);
List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
@Param("storeTypeId") Long storeTypeId,
@Param("versionNo") String versionNo);
List<MiniStoreWishlistListVO> listByLineId(@Param("lineId") Long lineId,
@Param("storeTypeId") Long storeTypeId);
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.mapper.store;
import com.cool.store.entity.store.StoreTypeDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface StoreTypeMapper extends Mapper<StoreTypeDO> {
List<StoreTypeDO> queryByCondition(@Param("keyword") String keyword,
@Param("active") Boolean active,
@Param("brand") String brand);
List<StoreTypeDO> listByStoreType(@Param("storeType") Integer storeType);
}

View File

@@ -0,0 +1,15 @@
package com.cool.store.mapper.store;
import com.cool.store.entity.store.StoreTypeOptionDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface StoreTypeOptionMapper extends Mapper<StoreTypeOptionDO> {
/**
* 批量新增
*/
int insertBatch(@Param("list") List<StoreTypeOptionDO> list);
}

View File

@@ -0,0 +1,14 @@
package com.cool.store.mapper.visit;
import com.cool.store.entity.visit.StoreVisitReservationDO;
import com.cool.store.request.visit.StoreVisitReservationAdminQueryRequest;
import com.cool.store.vo.visit.StoreVisitReservationVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface StoreVisitReservationMapper extends Mapper<StoreVisitReservationDO> {
List<StoreVisitReservationVO> adminPage(@Param("request") StoreVisitReservationAdminQueryRequest request);
}

View File

@@ -0,0 +1,15 @@
package com.cool.store.mapper.wallet;
import com.cool.store.entity.wallet.WalletTradeDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface WalletTradeMapper extends Mapper<WalletTradeDO> {
void insertBatch(List<WalletTradeDO> list);
int updateByPayNo(WalletTradeDO record);
int updateBatchByPayNo(@Param("list") List<WalletTradeDO> list);
}