Merge #8 into master from cc_20250922_closeStore_w
闭店
* cc_20250922_closeStore_w: (44 commits squashed)
- feat:闭店流程init
- feat:闭店流程接口
- feat:闭店
- Merge branch 'refs/heads/master' into cc_20250922_closeStore_w
- fix:闭店材料模块
- fix:账号关闭流程
- feat:闭店审批流程(未测);字典表
- fix:闭店审批流程完善
- Merge branch 'master' into cc_20250922_closeStore_w
- fix:闭店流程流转补充
- feat:闭店退款
- fix:字典表接口
- Merge branch 'master' into cc_20250922_closeStore_w
- fix:闭店原因接口新增闭店发起方式字段
- fix:修改审批记录返回数据类型
feat:新增退款流程跳过
- fix
- fix:新增字段
- feat:新增闭店退款提交人列表接口
- fix:闭店初始化数据来源修改;小程序闭店材料详情新增模板url字段
- fix:新增接口返回字段
- fix:闭店管理、审批待办类别所属品牌筛选改为多选
- fix:闭店管理列表新增完成阶段数量字段
- feat:新增第三方闭店申请接口
- Merge branch 'refs/heads/master' into cc_20250922_closeStore_w
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/constants/CommonConstants.java
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
#	coolstore-partner-common/src/main/java/com/cool/store/utils/BeanUtil.java
#	coolstore-partner-dao/src/main/java/com/cool/store/dao/StoreDao.java
#	coolstore-partner-dao/src/main/java/com/cool/store/mapper/StoreMapper.java
#	coolstore-partner-dao/src/main/resources/mapper/StoreMapper.xml
- fix:自动发起闭店申请定时任务
- feat:火码账号关闭
- fix:闭店流程修改
- Merge branch 'master' into cc_20250922_closeStore_w
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
#	coolstore-partner-web/src/main/java/com/cool/store/controller/webb/OpenApiController.java
- fix:删除云流水发起闭店接口
- fix:取消闭店申请入参修改
- fix:闭店申请列表赋值异常问题
- fix:闭店审批通过异常
- fix:普通方法参数校验
- fix:账号关闭时校验阶段状态
- fix:初始化
- fix:字段新增
- fix:接口补充
- fix
- Merge branch 'refs/heads/master' into cc_20250922_closeStore_w
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
#	coolstore-partner-common/src/main/java/com/cool/store/enums/RocketMqGroupEnum.java
#	coolstore-partner-common/src/main/java/com/cool/store/enums/RocketMqTagEnum.java
#	coolstore-partner-web/src/main/java/com/cool/store/controller/webb/OpenApiController.java
#	coolstore-partner-web/src/main/java/com/cool/store/controller/webc/TestController.java
- Merge branch 'refs/heads/master' into cc_20250922_closeStore_w
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/common/InsertGroup.java
#	coolstore-partner-common/src/main/java/com/cool/store/common/UpdateGroup.java
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
#	coolstore-partner-dao/src/main/java/com/cool/store/dao/StoreDao.java
#	coolstore-partner-dao/src/main/java/com/cool/store/dao/dict/SysDictColumnDAO.java
#	coolstore-partner-dao/src/main/java/com/cool/store/mapper/StoreMapper.java
#	coolstore-partner-dao/src/main/java/com/cool/store/mapper/dict/SysDictColumnMapper.java
#	coolstore-partner-dao/src/main/resources/mapper/StoreMapper.xml
#	coolstore-partner-dao/src/main/resources/mapper/dict/SysDictColumnMapper.xml
#	coolstore-partner-web/src/main/java/com/cool/store/controller/webb/DictManagerController.java
#	coolstore-partner-web/src/main/java/com/cool/store/job/XxlJobHandler.java
- fix:闭店流程修改
- fix:闭店流程修改
- fix:修改三方付款状态接口
- fix:闭店申请测试接口
Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Reviewed-by: 苏竹红 <accounts_68551bf01395375227aee211@mail.teambition.com>
Merged-by: 苏竹红 <accounts_68551bf01395375227aee211@mail.teambition.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/8
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.entity.CloseStoreAccountInfoDO;
|
||||
import com.cool.store.mapper.CloseStoreAccountInfoMapper;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/9/22 16:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class CloseStoreAccountInfoDAO {
|
||||
private final CloseStoreAccountInfoMapper closeStoreAccountInfoMapper;
|
||||
private final RedisUtilPool redisUtilPool;
|
||||
|
||||
/**
|
||||
* 根据闭店申请id查询
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 账号列表
|
||||
*/
|
||||
public List<CloseStoreAccountInfoDO> getByCloseStoreId(Long closeStoreId) {
|
||||
return closeStoreAccountInfoMapper.select(CloseStoreAccountInfoDO.builder().closeStoreId(closeStoreId).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键id查询
|
||||
* @param id 主键id
|
||||
* @return 账号信息
|
||||
*/
|
||||
public CloseStoreAccountInfoDO getById(Long id) {
|
||||
return closeStoreAccountInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账号状态
|
||||
* @param id 主键id
|
||||
* @param status 状态
|
||||
*/
|
||||
public void updateStatus(Long id, Integer status) {
|
||||
closeStoreAccountInfoMapper.updateByPrimaryKeySelective(CloseStoreAccountInfoDO.builder().id(id).status(status).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
* @param closeStoreId 闭店申请id
|
||||
*/
|
||||
public void init(Long closeStoreId) {
|
||||
String accountInitJson = redisUtilPool.getString(RedisConstant.CLOSE_STORE_ACCOUNT_INIT);
|
||||
List<CloseStoreAccountInfoDO> accountList = JSONObject.parseArray(accountInitJson, CloseStoreAccountInfoDO.class);
|
||||
accountList.forEach(v -> v.setCloseStoreId(closeStoreId));
|
||||
closeStoreAccountInfoMapper.insertBatch(accountList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在未关闭的账号
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 是否存在
|
||||
*/
|
||||
public boolean existNotCloseAccount(Long closeStoreId) {
|
||||
Example example = new Example(CloseStoreAccountInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andNotEqualTo("status", 2);
|
||||
return closeStoreAccountInfoMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.CloseStoreAuditRecordDO;
|
||||
import com.cool.store.enums.close.CloseStoreAuditStatusEnum;
|
||||
import com.cool.store.enums.close.RecordTypeEnum;
|
||||
import com.cool.store.mapper.CloseStoreAuditRecordMapper;
|
||||
import com.cool.store.request.close.store.CloseStoreQueryRequest;
|
||||
import com.cool.store.vo.close.store.CloseStoreInfoListVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/9/22 16:52
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class CloseStoreAuditRecordDAO {
|
||||
|
||||
@Resource
|
||||
private CloseStoreAuditRecordMapper closeStoreAuditRecordMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 提交新增记录
|
||||
* @param closeStoreId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public int addSubmitRecord(Long closeStoreId, String userId, String userName) {
|
||||
CloseStoreAuditRecordDO closeStoreAuditRecordDO = CloseStoreAuditRecordDO.builder()
|
||||
.closeStoreId(closeStoreId)
|
||||
.recordType(RecordTypeEnum.CLOSE_STORE_RECORD_TYPE_10.getRecordType())
|
||||
.actionRemark("")
|
||||
.finishTaskTime(new Date())
|
||||
.receiveTaskTime(new Date())
|
||||
.handlerUserId(userId)
|
||||
.handlerUserName(userName)
|
||||
.auditStatus(CloseStoreAuditStatusEnum.PASS.getStatus())
|
||||
.handlerUserIds(getUserIds(Collections.singletonList(userId)))
|
||||
.build();
|
||||
return closeStoreAuditRecordMapper.insertSelective(closeStoreAuditRecordDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交审批记录
|
||||
* @param closeStoreId
|
||||
* @param userIdList
|
||||
* @return
|
||||
*/
|
||||
public int addApproveRecord(Long closeStoreId, List<String> userIdList) {
|
||||
CloseStoreAuditRecordDO closeStoreAuditRecordDO = CloseStoreAuditRecordDO.builder()
|
||||
.closeStoreId(closeStoreId)
|
||||
.recordType(RecordTypeEnum.CLOSE_STORE_RECORD_TYPE_20.getRecordType())
|
||||
.receiveTaskTime(new Date())
|
||||
.handlerUserIds(getUserIds(userIdList))
|
||||
.auditStatus(CloseStoreAuditStatusEnum.PENDING.getStatus())
|
||||
.build();
|
||||
return closeStoreAuditRecordMapper.insertSelective(closeStoreAuditRecordDO);
|
||||
}
|
||||
|
||||
private String getUserIds(List<String> userIds) {
|
||||
String userIdStr = userIds.stream()
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.distinct()
|
||||
.collect(Collectors.joining(","));
|
||||
return "," + userIdStr + ",";
|
||||
}
|
||||
|
||||
/**
|
||||
* 首次发起流程 添加审批记录
|
||||
*/
|
||||
public void addRecord(Long closeStoreId, String userId, String userName, List<String> userIdList) {
|
||||
//新增提交审批
|
||||
addSubmitRecord(closeStoreId, userId, userName);
|
||||
//新增审批记录
|
||||
addApproveRecord(closeStoreId, userIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批记录更新
|
||||
* @param closeStoreAuditRecordDO
|
||||
*/
|
||||
public void updateRecord(CloseStoreAuditRecordDO closeStoreAuditRecordDO) {
|
||||
closeStoreAuditRecordMapper.updateByPrimaryKeySelective(closeStoreAuditRecordDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程记录列表
|
||||
* @param closeStoreId
|
||||
* @return
|
||||
*/
|
||||
public List<CloseStoreAuditRecordDO> getRecordListByCloseStoreId(Long closeStoreId) {
|
||||
if (closeStoreId == null){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return closeStoreAuditRecordMapper.getRecordListByCloseStoreId(closeStoreId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询审批记录
|
||||
* @param id 审批记录id
|
||||
* @return 审批记录
|
||||
*/
|
||||
public CloseStoreAuditRecordDO getById(Long id) {
|
||||
return closeStoreAuditRecordMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除待处理的审批记录
|
||||
* @param closeStoreId 闭店申请id
|
||||
*/
|
||||
public void deletePendingRecord(Long closeStoreId) {
|
||||
Example example = new Example(CloseStoreAuditRecordDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andEqualTo("auditStatus", CloseStoreAuditStatusEnum.PENDING.getStatus())
|
||||
.andEqualTo("deleted", 0);
|
||||
closeStoreAuditRecordMapper.updateByExampleSelective(CloseStoreAuditRecordDO.builder().deleted(1).build(), example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限下的闭店申请审批记录
|
||||
* @param request 闭店申请查询Request
|
||||
* @param userId 用户id
|
||||
* @param isAdmin 是管理员权限
|
||||
* @return 闭店申请记录列表VO列表
|
||||
*/
|
||||
public PageInfo<CloseStoreInfoListVO> getCloseStoreAuditList(CloseStoreQueryRequest request, String userId, Boolean isAdmin) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<CloseStoreInfoListVO> list = closeStoreAuditRecordMapper.getCloseStoreAuditList(request, userId, isAdmin);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据闭店申请id查询审批记录
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 审批记录列表
|
||||
*/
|
||||
public List<CloseStoreAuditRecordDO> getListByCloseStoreId(Long closeStoreId) {
|
||||
Example example = new Example(CloseStoreAuditRecordDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andEqualTo("deleted", 0);
|
||||
example.setOrderByClause("id ASC");
|
||||
return closeStoreAuditRecordMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待处理的审批记录
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 闭店申请审批记录
|
||||
*/
|
||||
public CloseStoreAuditRecordDO getPendingAuditRecord(Long closeStoreId) {
|
||||
Example example = new Example(CloseStoreAuditRecordDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andEqualTo("auditStatus", CloseStoreAuditStatusEnum.PENDING.getStatus())
|
||||
.andEqualTo("deleted", 0);
|
||||
return closeStoreAuditRecordMapper.selectOneByExample(example);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.request.close.file.CloseStoreMailAddressRequest;
|
||||
import com.cool.store.entity.CloseStoreFileDetailDO;
|
||||
import com.cool.store.mapper.CloseStoreFileDetailMapper;
|
||||
import com.cool.store.request.close.file.CloseStoreFileApproveRequest;
|
||||
import com.cool.store.request.close.file.CloseStoreMailInfoRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店资料详情DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/7
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Repository
|
||||
public class CloseStoreFileDetailDAO {
|
||||
private final CloseStoreFileDetailMapper closeStoreFileDetailMapper;
|
||||
|
||||
/**
|
||||
* 新增或编辑闭店资料邮寄地址信息
|
||||
* @param request 闭店资料邮寄地址信息Request
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean insertOrUpdateMailAddress(CloseStoreMailAddressRequest request) {
|
||||
return closeStoreFileDetailMapper.insertOrUpdateMailAddress(request) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或编辑闭店资料邮寄信息
|
||||
* @param request 闭店资料邮寄信息Request
|
||||
* @param mailStatus 邮寄状态
|
||||
*/
|
||||
public void insertOrUpdateMailInfo(CloseStoreMailInfoRequest request, Boolean mailStatus) {
|
||||
closeStoreFileDetailMapper.insertOrUpdateMailInfo(request, mailStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或编辑闭店资料信息
|
||||
*
|
||||
* @param request 闭店材料审批Request
|
||||
*/
|
||||
public void insertOrUpdateFileInfoSelective(CloseStoreFileApproveRequest request, Boolean approveComplete) {
|
||||
closeStoreFileDetailMapper.insertOrUpdateFileInfoSelective(request, approveComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据闭店申请id查询
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 闭店资料详情
|
||||
*/
|
||||
public CloseStoreFileDetailDO getByCloseStoreId(Long closeStoreId) {
|
||||
return closeStoreFileDetailMapper.selectOne(CloseStoreFileDetailDO.builder().closeStoreId(closeStoreId).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
* @param closeStoreId 闭店申请id
|
||||
*/
|
||||
public void init(Long closeStoreId) {
|
||||
CloseStoreFileDetailDO detailDO = CloseStoreFileDetailDO.builder().closeStoreId(closeStoreId).build();
|
||||
closeStoreFileDetailMapper.insertSelective(detailDO);
|
||||
}
|
||||
|
||||
public void updateByCloseStoreIdSelective(CloseStoreFileDetailDO detailDO) {
|
||||
Example example = new Example(CloseStoreFileDetailDO.class);
|
||||
example.createCriteria().andEqualTo("closeStoreId", detailDO.getCloseStoreId());
|
||||
closeStoreFileDetailMapper.updateByExampleSelective(detailDO, example);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.entity.CloseStoreFileInfoDO;
|
||||
import com.cool.store.enums.close.FileStatusEnum;
|
||||
import com.cool.store.mapper.CloseStoreFileInfoMapper;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/9/22 16:53
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class CloseStoreFileInfoDAO {
|
||||
private final CloseStoreFileInfoMapper closeStoreFileInfoMapper;
|
||||
private final RedisUtilPool redisUtilPool;
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
* @param list 实体列表
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean updateBatch(List<CloseStoreFileInfoDO> list) {
|
||||
return closeStoreFileInfoMapper.updateBatch(list) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据闭店申请id查询
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 实体列表
|
||||
*/
|
||||
public List<CloseStoreFileInfoDO> getByCloseStoreId(Long closeStoreId) {
|
||||
return closeStoreFileInfoMapper.select(CloseStoreFileInfoDO.builder().closeStoreId(closeStoreId).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
* @param closeStoreId 闭店申请id
|
||||
*/
|
||||
public void init(Long closeStoreId) {
|
||||
String fileInitJson = redisUtilPool.getString(RedisConstant.CLOSE_STORE_FILE_INIT);
|
||||
List<CloseStoreFileInfoDO> list = JSONObject.parseArray(fileInitJson, CloseStoreFileInfoDO.class);
|
||||
list.forEach(v -> v.setCloseStoreId(closeStoreId));
|
||||
closeStoreFileInfoMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交材料
|
||||
*/
|
||||
public Boolean updateFile(Long id, String urls) {
|
||||
return closeStoreFileInfoMapper.updateFile(id, urls) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据闭店申请id将所有资料状态改为审批中
|
||||
*/
|
||||
public void updateAllFileStatus(Long closeStoreId) {
|
||||
Example example = new Example(CloseStoreFileInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId);
|
||||
closeStoreFileInfoMapper.updateByExampleSelective(CloseStoreFileInfoDO.builder().fileStatus(FileStatusEnum.APPROVING.getStatus()).build(), example);
|
||||
}
|
||||
|
||||
public void updateSelective(CloseStoreFileInfoDO closeStoreFileInfoDO) {
|
||||
closeStoreFileInfoMapper.updateByPrimaryKeySelective(closeStoreFileInfoDO);
|
||||
}
|
||||
|
||||
public CloseStoreFileInfoDO getById(Long id) {
|
||||
return closeStoreFileInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新材料状态为审批状态
|
||||
* @param closeStoreId 闭店申请id
|
||||
*/
|
||||
public void updateFileStatusToApproveStatus(Long closeStoreId) {
|
||||
closeStoreFileInfoMapper.updateFileStatusToApproveStatus(closeStoreId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.CloseStoreInfoDO;
|
||||
import com.cool.store.enums.close.CloseStoreStatusEnum;
|
||||
import com.cool.store.mapper.CloseStoreInfoMapper;
|
||||
import com.cool.store.request.close.store.CloseStoreQueryRequest;
|
||||
import com.cool.store.vo.close.store.CloseStoreInfoListVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/9/22 16:52
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class CloseStoreInfoDAO {
|
||||
@Resource
|
||||
private CloseStoreInfoMapper closeStoreInfoMapper;
|
||||
|
||||
public int insertSelective(CloseStoreInfoDO closeStoreInfoDO) {
|
||||
return closeStoreInfoMapper.insertSelective(closeStoreInfoDO);
|
||||
}
|
||||
public int updateSelective(CloseStoreInfoDO closeStoreInfoDO) {
|
||||
return closeStoreInfoMapper.updateByPrimaryKeySelective(closeStoreInfoDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
* @param id 主键id
|
||||
* @return 闭店信息
|
||||
*/
|
||||
public CloseStoreInfoDO getById(Long id) {
|
||||
return closeStoreInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在进行中的闭店申请
|
||||
* @param storeId 门店id
|
||||
* @return 是否存在
|
||||
*/
|
||||
public boolean existOngoingRecord(String storeId) {
|
||||
Example example = new Example(CloseStoreInfoDO.class);
|
||||
example.createCriteria().andEqualTo("storeId", storeId)
|
||||
.andIn("closeStatus", Arrays.asList(CloseStoreStatusEnum.UNDER_APPROVAL.getCloseStoreStatus(), CloseStoreStatusEnum.CLOSING.getCloseStoreStatus()));
|
||||
return closeStoreInfoMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询闭店申请记录
|
||||
* @param request 闭店申请查询Request
|
||||
* @return 闭店申请记录列表VO
|
||||
*/
|
||||
public PageInfo<CloseStoreInfoListVO> getCloseStoreInfoList(CloseStoreQueryRequest request, List<String> regionIds) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<CloseStoreInfoListVO> list = closeStoreInfoMapper.getCloseStoreInfoList(request, regionIds);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据申请人id查询闭店申请记录
|
||||
* @param applyUserId 申请人id
|
||||
* @return 闭店申请记录列表
|
||||
*/
|
||||
public List<CloseStoreInfoDO> getListByApplyUserId(String applyUserId, Integer closeType, String storeId) {
|
||||
Example example = new Example(CloseStoreInfoDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("applyUserId", applyUserId);
|
||||
if (StringUtils.isNotBlank(storeId)) {
|
||||
criteria.andEqualTo("storeId", storeId);
|
||||
}
|
||||
if (Objects.nonNull(closeType)) {
|
||||
criteria.andEqualTo("closeType", closeType);
|
||||
}
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return closeStoreInfoMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.CloseStoreRefundInfoDO;
|
||||
import com.cool.store.enums.close.RefundPayStatusEnum;
|
||||
import com.cool.store.mapper.CloseStoreRefundInfoMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店退款信息DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/13
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class CloseStoreRefundInfoDAO {
|
||||
private final CloseStoreRefundInfoMapper closeStoreRefundInfoMapper;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
public CloseStoreRefundInfoDO getById(Long id) {
|
||||
return closeStoreRefundInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新退款状态
|
||||
* @param id id
|
||||
* @param refundStatus 退款状态
|
||||
*/
|
||||
public void updateRefundStatus(Long id, String refundStatus, Date refundTime) {
|
||||
closeStoreRefundInfoMapper.updateByPrimaryKeySelective(CloseStoreRefundInfoDO.builder().id(id).refundStatus(refundStatus).refundTime(refundTime).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id批量更新退款状态
|
||||
* @param list 退款信息列表
|
||||
*/
|
||||
public void updateRefundStatusBatchById(List<CloseStoreRefundInfoDO> list) {
|
||||
closeStoreRefundInfoMapper.updateRefundStatusBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public boolean updateSelective(CloseStoreRefundInfoDO closeStoreRefundInfoDO) {
|
||||
return closeStoreRefundInfoMapper.updateByPrimaryKeySelective(closeStoreRefundInfoDO) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public boolean insertSelective(CloseStoreRefundInfoDO closeStoreRefundInfoDO) {
|
||||
return closeStoreRefundInfoMapper.insertSelective(closeStoreRefundInfoDO) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据闭店申请id查询
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @param type 退款类型(闭店子阶段code)
|
||||
* @return 退款信息
|
||||
*/
|
||||
public CloseStoreRefundInfoDO getByCloseStoreId(Long closeStoreId, Integer type) {
|
||||
return closeStoreRefundInfoMapper.selectOne(CloseStoreRefundInfoDO.builder().closeStoreId(closeStoreId).type(type).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据闭店申请id查询列表
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 退款信息列表
|
||||
*/
|
||||
public List<CloseStoreRefundInfoDO> getListByCloseStoreId(Long closeStoreId, Integer type) {
|
||||
Example example = new Example(CloseStoreRefundInfoDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId);
|
||||
if (Objects.nonNull(type)) {
|
||||
criteria.andEqualTo("type", type);
|
||||
}
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return closeStoreRefundInfoMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
*/
|
||||
public void removeById(Long id) {
|
||||
closeStoreRefundInfoMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在非作废状态的记录
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @param type 退款类型
|
||||
* @return 是否存在
|
||||
*/
|
||||
public boolean existEffectiveRecord(Long closeStoreId, Integer type) {
|
||||
Example example = new Example(CloseStoreRefundInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andNotEqualTo("refundStatus", RefundPayStatusEnum.ABANDON.getStatus())
|
||||
.andEqualTo("type", type);
|
||||
return closeStoreRefundInfoMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未完成的退款记录
|
||||
* @return 退款信息
|
||||
*/
|
||||
public List<CloseStoreRefundInfoDO> getUnfinishedRecords() {
|
||||
Example example = new Example(CloseStoreRefundInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andNotIn("refundStatus", Arrays.asList(RefundPayStatusEnum.PAY_SUCCESS.getStatus(), RefundPayStatusEnum.ABANDON.getStatus()));
|
||||
return closeStoreRefundInfoMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.cool.store.entity.CloseStoreStageInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.close.CloseStoreStageEnum;
|
||||
import com.cool.store.enums.close.CloseStoreSubStageEnum;
|
||||
import com.cool.store.enums.close.CloseStoreSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.CloseStoreStageInfoMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/9/22 16:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class CloseStoreStageInfoDAO {
|
||||
|
||||
@Resource
|
||||
private CloseStoreStageInfoMapper closeStoreStageInfoMapper;
|
||||
|
||||
/**
|
||||
* 根据闭店阶段查询闭店阶段信息
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @param shopStage 闭店阶段
|
||||
* @param shopSubStage 闭店子阶段,非必填
|
||||
* @return 闭店阶段信息
|
||||
*/
|
||||
public CloseStoreStageInfoDO getByStage(Long closeStoreId, Integer shopStage, Integer shopSubStage) {
|
||||
Example example = new Example(CloseStoreStageInfoDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andEqualTo("shopStage", shopStage)
|
||||
.andEqualTo("deleted", 0);
|
||||
if (Objects.nonNull(shopSubStage)) {
|
||||
criteria.andEqualTo("shopSubStage", shopSubStage);
|
||||
}
|
||||
return closeStoreStageInfoMapper.selectOneByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据子阶段查询闭店阶段信息
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @param subStageList 子阶段列表
|
||||
* @return 阶段信息列表
|
||||
*/
|
||||
public List<CloseStoreStageInfoDO> getBySubStage(Long closeStoreId, List<Integer> subStageList) {
|
||||
if (CollectionUtils.isEmpty(subStageList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Example example = new Example(CloseStoreStageInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andIn("shopSubStage", subStageList)
|
||||
.andEqualTo("deleted", 0);
|
||||
return closeStoreStageInfoMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询闭店阶段信息
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 阶段信息列表
|
||||
*/
|
||||
public List<CloseStoreStageInfoDO> getList(Long closeStoreId) {
|
||||
Example example = new Example(CloseStoreStageInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andEqualTo("deleted", 0);
|
||||
example.setOrderByClause("shop_sub_stage ASC");
|
||||
return closeStoreStageInfoMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 存在未完成的闭店阶段
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean existUnfinishedStage(Long closeStoreId) {
|
||||
return closeStoreStageInfoMapper.selectCount(
|
||||
CloseStoreStageInfoDO.builder()
|
||||
.closeStoreId(closeStoreId)
|
||||
.isTerminated(0)
|
||||
.deleted(0)
|
||||
.build()
|
||||
) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验闭店阶段流程是否为期望流程
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @param shopStage 闭店阶段
|
||||
* @param shopSubStage 闭店子阶段
|
||||
* @param expectedStageStatus 期望闭店子阶段状态
|
||||
*/
|
||||
public void verifyStage(Long closeStoreId, CloseStoreStageEnum shopStage, CloseStoreSubStageEnum shopSubStage, CloseStoreSubStageStatusEnum... expectedStageStatus) {
|
||||
CloseStoreStageInfoDO stageInfoDO = getByStage(closeStoreId, shopStage.getCloseStoreStage(), Objects.nonNull(shopSubStage) ? shopSubStage.getCloseStoreSubStage() : null);
|
||||
if (Objects.isNull(stageInfoDO)) {
|
||||
throw new RuntimeException("未查询到审批阶段信息");
|
||||
}
|
||||
if (Objects.nonNull(expectedStageStatus) && expectedStageStatus.length > 0) {
|
||||
for (CloseStoreSubStageStatusEnum stageStatus : expectedStageStatus) {
|
||||
if (stageStatus.getShopSubStageStatus().equals(stageInfoDO.getShopSubStageStatus())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new ServiceException(ErrorCodeEnum.CLOSE_STORE_SUB_STAGE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化闭店阶段信息
|
||||
* @param closeStoreId 闭店申请id
|
||||
*/
|
||||
public void initStageInfo(Long closeStoreId) {
|
||||
List<CloseStoreStageInfoDO> stageInfoList = new ArrayList<>();
|
||||
LocalDate now = LocalDate.now();
|
||||
for (CloseStoreSubStageEnum subStageEnum : CloseStoreSubStageEnum.values()) {
|
||||
CloseStoreSubStageStatusEnum initStatus = subStageEnum.getInitStatus();
|
||||
CloseStoreStageInfoDO stageInfo = CloseStoreStageInfoDO.builder()
|
||||
.closeStoreId(closeStoreId)
|
||||
.shopStage(subStageEnum.getCloseStoreStageEnum().getCloseStoreStage())
|
||||
.shopSubStage(subStageEnum.getCloseStoreSubStage())
|
||||
.shopSubStageStatus(Objects.nonNull(initStatus) ? initStatus.getShopSubStageStatus() : CloseStoreSubStageStatusEnum.CLOSE_STORE_SUB_STAGE_STATUS_00.getShopSubStageStatus())
|
||||
.isTerminated(0)
|
||||
.planCompleteTime(subStageEnum.getPlanCompleteTime(now))
|
||||
.build();
|
||||
stageInfoList.add(stageInfo);
|
||||
}
|
||||
closeStoreStageInfoMapper.insertBatch(stageInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新Selective
|
||||
* @param list 阶段信息列表
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean updateBatchSelective(List<CloseStoreStageInfoDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return false;
|
||||
}
|
||||
return closeStoreStageInfoMapper.updateBatchSelective(list) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新Selective
|
||||
* @param stageInfoDO 阶段信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean updateSelective(CloseStoreStageInfoDO stageInfoDO) {
|
||||
return closeStoreStageInfoMapper.updateByPrimaryKeySelective(stageInfoDO) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 已完成阶段数
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @return 已完成阶段数
|
||||
*/
|
||||
public int getCompleteCount(Long closeStoreId) {
|
||||
Example example = new Example(CloseStoreStageInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andEqualTo("isTerminated", 1)
|
||||
.andEqualTo("deleted", 0);
|
||||
return closeStoreStageInfoMapper.selectCountByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已完成阶段数
|
||||
* @param closeStoreIds 闭店申请id列表
|
||||
* @return 已完成阶段数
|
||||
*/
|
||||
public Map<Long, Long> getCompleteCountMap(List<Long> closeStoreIds) {
|
||||
if (CollectionUtils.isEmpty(closeStoreIds)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Example example = new Example(CloseStoreStageInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andIn("closeStoreId", closeStoreIds)
|
||||
.andEqualTo("isTerminated", 1)
|
||||
.andEqualTo("deleted", 0);
|
||||
example.selectProperties("closeStoreId");
|
||||
List<CloseStoreStageInfoDO> list = closeStoreStageInfoMapper.selectByExample(example);
|
||||
return CollStreamUtil.groupBy(list, CloseStoreStageInfoDO::getCloseStoreId, Collectors.counting());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改子阶段状态
|
||||
* @param closeStoreId 闭店申请id
|
||||
* @param subStatus 子阶段状态枚举类
|
||||
*/
|
||||
public void updateSubStageStatus(Long closeStoreId, CloseStoreSubStageStatusEnum subStatus) {
|
||||
CloseStoreSubStageEnum subStage = subStatus.getCloseStoreSubStageEnum();
|
||||
Example example = new Example(CloseStoreStageInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("closeStoreId", closeStoreId)
|
||||
.andEqualTo("shopSubStage", subStage.getCloseStoreSubStage())
|
||||
.andEqualTo("deleted", 0);
|
||||
closeStoreStageInfoMapper.updateByExampleSelective(CloseStoreStageInfoDO.builder().shopSubStageStatus(subStatus.getShopSubStageStatus()).build(), example);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,10 @@ import org.springframework.stereotype.Repository;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class StoreDao {
|
||||
@@ -146,4 +150,35 @@ public class StoreDao {
|
||||
public boolean updateStoreScore(String storeId, BigDecimal score) {
|
||||
return storeMapper.updateStoreScore(storeId, score) > 0;
|
||||
}
|
||||
/**
|
||||
* 修改门店营业状态
|
||||
* @param storeId 门店id
|
||||
* @param storeStatus 门店营业状态
|
||||
*/
|
||||
public void updateStoreStatus(String storeId, String storeStatus) {
|
||||
storeMapper.updateStoreStatus(storeId,storeStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店状态改为闭店
|
||||
* @param storeId 门店id
|
||||
* @param closeReason 闭店原因
|
||||
* @param closeNature 闭店性质
|
||||
*/
|
||||
public void closeStore(String storeId, Integer closeReason, Integer closeNature, Date actualCloseData) {
|
||||
if (storeMapper.closeStore(storeId, actualCloseData) > 0) {
|
||||
storeMapper.insertOrUpdateCloseInfo(storeId, closeReason, closeNature);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询最近没有订货记录的门店
|
||||
* @param latestDate 最近订货时间
|
||||
* @param businessTypes 商圈类型
|
||||
* @param inBusinessType 在列表内
|
||||
* @return 门店列表
|
||||
*/
|
||||
public List<StoreDO> getNoOrderStore(LocalDate latestDate, List<String> businessTypes, Boolean inBusinessType) {
|
||||
return storeMapper.getNoOrderStore(latestDate, businessTypes, inBusinessType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,4 +34,11 @@ public class StoreMasterSignerInfoDAO {
|
||||
List<StoreMasterSignerInfoDO> list = storeMasterSignerInfoMapper.selectByStoreIds(storeIds);
|
||||
return CollStreamUtil.toMap(list, StoreMasterSignerInfoDO::getStoreId, v -> v);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据门店id查询
|
||||
*/
|
||||
public StoreMasterSignerInfoDO getByStoreId(String storeId) {
|
||||
return storeMasterSignerInfoMapper.selectOne(StoreMasterSignerInfoDO.builder().storeId(storeId).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.CloseStoreAccountInfoDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CloseStoreAccountInfoMapper extends Mapper<CloseStoreAccountInfoDO> {
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param list 账号列表
|
||||
* @return int
|
||||
*/
|
||||
int insertBatch(List<CloseStoreAccountInfoDO> list);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.CloseStoreAuditRecordDO;
|
||||
import com.cool.store.request.close.store.CloseStoreQueryRequest;
|
||||
import com.cool.store.vo.close.store.CloseStoreInfoListVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CloseStoreAuditRecordMapper extends Mapper<CloseStoreAuditRecordDO> {
|
||||
|
||||
/**
|
||||
* 根据closeStoreId查询记录
|
||||
* @param closeStoreId
|
||||
* @return
|
||||
*/
|
||||
List<CloseStoreAuditRecordDO> getRecordListByCloseStoreId( @Param("closeStoreId") Long closeStoreId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询权限下的闭店申请审批记录
|
||||
* @param request 闭店申请查询Request
|
||||
* @param userId 用户id
|
||||
* @param isAdmin 是管理员权限
|
||||
* @return 闭店申请记录列表VO列表
|
||||
*/
|
||||
List<CloseStoreInfoListVO> getCloseStoreAuditList(@Param("request") CloseStoreQueryRequest request,
|
||||
@Param("userId") String userId,
|
||||
@Param("isAdmin") Boolean isAdmin);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.request.close.file.CloseStoreMailAddressRequest;
|
||||
import com.cool.store.entity.CloseStoreFileDetailDO;
|
||||
import com.cool.store.request.close.file.CloseStoreFileApproveRequest;
|
||||
import com.cool.store.request.close.file.CloseStoreMailInfoRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface CloseStoreFileDetailMapper extends Mapper<CloseStoreFileDetailDO> {
|
||||
|
||||
/**
|
||||
* 新增或编辑闭店资料邮寄地址信息
|
||||
* @param request 闭店资料邮寄地址信息Request
|
||||
* @return int
|
||||
*/
|
||||
int insertOrUpdateMailAddress(CloseStoreMailAddressRequest request);
|
||||
|
||||
/**
|
||||
* 新增或编辑闭店资料邮寄信息
|
||||
* @param request 闭店资料邮寄信息Request
|
||||
* @param mailStatus 邮寄状态
|
||||
* @return int
|
||||
*/
|
||||
int insertOrUpdateMailInfo(@Param("request") CloseStoreMailInfoRequest request,
|
||||
@Param("mailStatus") Boolean mailStatus);
|
||||
|
||||
/**
|
||||
* 新增或编辑闭店资料信息
|
||||
* @param request 闭店材料审批Request
|
||||
* @return int
|
||||
*/
|
||||
int insertOrUpdateFileInfoSelective(@Param("request") CloseStoreFileApproveRequest request,
|
||||
@Param("approveComplete") Boolean approveComplete);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.CloseStoreFileInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CloseStoreFileInfoMapper extends Mapper<CloseStoreFileInfoDO> {
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
* @param list 实体列表
|
||||
* @return int
|
||||
*/
|
||||
int updateBatch(List<CloseStoreFileInfoDO> list);
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param list 实体列表
|
||||
* @return int
|
||||
*/
|
||||
int insertBatch(List<CloseStoreFileInfoDO> list);
|
||||
|
||||
/**
|
||||
* 修改材料
|
||||
* @param id 主键id
|
||||
* @param urls 图片列表
|
||||
*/
|
||||
int updateFile(@Param("id") Long id, @Param("urls") String urls);
|
||||
|
||||
/**
|
||||
* 更新材料状态为审批状态
|
||||
* @param closeStoreId 闭店申请id
|
||||
*/
|
||||
void updateFileStatusToApproveStatus(@Param("closeStoreId") Long closeStoreId);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.CloseStoreInfoDO;
|
||||
import com.cool.store.request.close.store.CloseStoreQueryRequest;
|
||||
import com.cool.store.vo.close.store.CloseStoreInfoListVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CloseStoreInfoMapper extends Mapper<CloseStoreInfoDO> {
|
||||
|
||||
/**
|
||||
* 查询闭店申请记录
|
||||
* @param request 闭店申请查询Request
|
||||
* @return 闭店申请记录列表VO
|
||||
*/
|
||||
List<CloseStoreInfoListVO> getCloseStoreInfoList(@Param("request") CloseStoreQueryRequest request, @Param("regionIds") List<String> regionIds);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.CloseStoreRefundInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CloseStoreRefundInfoMapper extends Mapper<CloseStoreRefundInfoDO> {
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
void insertBatch(@Param("list") List<CloseStoreRefundInfoDO> list);
|
||||
|
||||
/**
|
||||
* 根据id批量更新退款状态
|
||||
*/
|
||||
void updateRefundStatusBatchById(@Param("list") List<CloseStoreRefundInfoDO> list);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.CloseStoreStageInfoDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CloseStoreStageInfoMapper extends Mapper<CloseStoreStageInfoDO> {
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param list 阶段信息列表
|
||||
* @return int
|
||||
*/
|
||||
int insertBatch(List<CloseStoreStageInfoDO> list);
|
||||
|
||||
/**
|
||||
* 批量更新Selective
|
||||
* @param list 阶段信息列表
|
||||
* @return int
|
||||
*/
|
||||
int updateBatchSelective(List<CloseStoreStageInfoDO> list);
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@@ -78,4 +80,34 @@ public interface StoreMapper {
|
||||
* @param score 积分
|
||||
*/
|
||||
int updateStoreScore(String storeId, BigDecimal score);
|
||||
/**
|
||||
* 修改门店营业状态
|
||||
* @param storeId 门店id
|
||||
* @param storeStatus 门店营业状态
|
||||
*/
|
||||
void updateStoreStatus(@Param("storeId") String storeId, @Param("storeStatus") String storeStatus);
|
||||
|
||||
/**
|
||||
* 门店状态改为闭店
|
||||
* @param storeId 门店id
|
||||
*/
|
||||
int closeStore(@Param("storeId") String storeId, @Param("actualCloseData") Date actualCloseData);
|
||||
|
||||
/**
|
||||
* 新增或编辑闭店信息
|
||||
* @param storeId 门店id
|
||||
* @param closeReason 闭店原因
|
||||
* @param closeNature 闭店性质
|
||||
* @return int
|
||||
*/
|
||||
int insertOrUpdateCloseInfo(@Param("storeId") String storeId, @Param("closeReason") Integer closeReason, @Param("closeNature") Integer closeNature);
|
||||
|
||||
/**
|
||||
* 查询最近没有订货记录的门店
|
||||
* @param latestDate 最近订货时间
|
||||
* @param businessTypes 商圈类型
|
||||
* @param inBusinessType 在列表内
|
||||
* @return 门店列表
|
||||
*/
|
||||
List<StoreDO> getNoOrderStore(@Param("latestDate") LocalDate latestDate, @Param("businessTypes") List<String> businessTypes, @Param("inBusinessType") Boolean inBusinessType);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.mapper.store;
|
||||
|
||||
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -10,7 +11,7 @@ import java.util.List;
|
||||
* @author zhangchenbiao
|
||||
* @date 2025-09-23 11:32
|
||||
*/
|
||||
public interface StoreMasterSignerInfoMapper {
|
||||
public interface StoreMasterSignerInfoMapper extends Mapper<StoreMasterSignerInfoDO> {
|
||||
|
||||
/**
|
||||
* 根据门店id查询签约信息
|
||||
|
||||
Reference in New Issue
Block a user