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查询签约信息
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.CloseStoreAccountInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.CloseStoreAccountInfoDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="close_store_id" jdbcType="BIGINT" property="closeStoreId" />
|
||||
<result column="system_name" jdbcType="VARCHAR" property="systemName" />
|
||||
<result column="system_code" jdbcType="VARCHAR" property="systemCode" />
|
||||
<result column="account_type" jdbcType="VARCHAR" property="accountType" />
|
||||
<result column="status" jdbcType="BIT" property="status" />
|
||||
<result column="close_type" jdbcType="TINYINT" property="closeType" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_close_store_account_info (close_store_id, system_name, system_code, account_type, status, close_type)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.closeStoreId}, #{item.systemName}, #{item.systemCode}, #{item.accountType}, #{item.status}, #{item.closeType})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.CloseStoreAuditRecordMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.CloseStoreAuditRecordDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="close_store_id" jdbcType="BIGINT" property="closeStoreId" />
|
||||
<result column="record_type" jdbcType="TINYINT" property="recordType" />
|
||||
<result column="action_remark" jdbcType="VARCHAR" property="actionRemark" />
|
||||
<result column="handler_user_id" jdbcType="VARCHAR" property="handlerUserId" />
|
||||
<result column="handler_user_name" jdbcType="VARCHAR" property="handlerUserName" />
|
||||
<result column="handler_user_ids" jdbcType="VARCHAR" property="handlerUserIds" />
|
||||
<result column="receive_task_time" jdbcType="TIMESTAMP" property="receiveTaskTime" />
|
||||
<result column="finish_task_time" jdbcType="TIMESTAMP" property="finishTaskTime" />
|
||||
<result column="audit_status" jdbcType="TINYINT" property="auditStatus" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getRecordListByCloseStoreId" resultMap="BaseResultMap">
|
||||
select
|
||||
*
|
||||
from zxjp_close_store_audit_record
|
||||
where close_store_id = #{closeStoreId}
|
||||
</select>
|
||||
|
||||
<select id="getCloseStoreAuditList" resultType="com.cool.store.vo.close.store.CloseStoreInfoListVO">
|
||||
SELECT a.id audit_record_id, a.close_store_id, b.plan_close_data, b.close_type, b.close_status, b.close_store_no, b.store_id
|
||||
<if test="request.queryStore">
|
||||
, c.store_name, c.store_num, c.join_brand, c.store_address
|
||||
</if>
|
||||
<if test="request.querySigner">
|
||||
, d.signer1_name, d.signer1_mobile, d.signer2_name, d.signer2_mobile
|
||||
</if>
|
||||
FROM zxjp_close_store_audit_record a
|
||||
LEFT JOIN zxjp_close_store_info b ON a.close_store_id = b.id
|
||||
<if test="request.queryStore">
|
||||
LEFT JOIN store_${enterpriseId} c ON b.store_id = c.store_id
|
||||
</if>
|
||||
<if test="request.querySigner">
|
||||
LEFT JOIN store_master_signer_info_${enterpriseId} d ON b.store_id = d.store_id
|
||||
</if>
|
||||
<where>
|
||||
<if test="isAdmin == null or !isAdmin">
|
||||
AND handler_user_ids LIKE CONCAT('%,', #{userId}, ',%')
|
||||
</if>
|
||||
<if test="request.auditStatus != null">
|
||||
AND a.audit_status = #{request.auditStatus}
|
||||
</if>
|
||||
<if test="request.closeType != null">
|
||||
AND b.close_type = #{request.closeType}
|
||||
</if>
|
||||
<if test="request.closeStatus != null">
|
||||
<choose>
|
||||
<when test="request.closeStatus == 1">
|
||||
AND (b.close_status = 1 OR b.close_status = 2)
|
||||
</when>
|
||||
<otherwise>
|
||||
AND b.close_status = #{request.closeStatus}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="request.closeStoreNo != null and request.closeStoreNo != ''">
|
||||
AND b.close_store_no LIKE CONCAT('%', #{request.closeStoreNo}, '%')
|
||||
</if>
|
||||
<if test="request.queryStore and request.storeNameOrNum != null and request.storeNameOrNum != ''">
|
||||
AND (c.store_name LIKE CONCAT('%', #{request.storeNameOrNum}, '%') OR c.store_num LIKE CONCAT('%', #{request.storeNameOrNum}, '%'))
|
||||
</if>
|
||||
<if test="request.queryStore and request.joinBrands != null and !request.joinBrands.isEmpty()">
|
||||
AND c.join_brand IN
|
||||
<foreach item="item" collection="request.joinBrands" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.querySigner and request.signerName != null and request.signerName != ''">
|
||||
AND (d.signer1_name LIKE CONCAT('%', #{request.signerName}, '%') OR d.signer2_name LIKE CONCAT('%', #{request.signerName}, '%'))
|
||||
</if>
|
||||
<if test="request.querySigner and request.signerMobile != null and request.signerMobile != ''">
|
||||
AND (d.signer1_mobile LIKE CONCAT('%', #{request.signerMobile}, '%') OR d.signer2_mobile LIKE CONCAT('%', #{request.signerMobile}, '%'))
|
||||
</if>
|
||||
AND a.deleted = 0
|
||||
</where>
|
||||
ORDER BY b.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.CloseStoreFileDetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.CloseStoreFileDetailDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="close_store_id" jdbcType="BIGINT" property="closeStoreId" />
|
||||
<result column="approve_complete" jdbcType="BIT" property="approveComplete" />
|
||||
<result column="mail_number" jdbcType="VARCHAR" property="mailNumber" />
|
||||
<result column="mail_status" jdbcType="BIT" property="mailStatus" />
|
||||
<result column="mail_address" jdbcType="VARCHAR" property="mailAddress" />
|
||||
<result column="mail_addressee" jdbcType="VARCHAR" property="mailAddressee" />
|
||||
<result column="mail_mobile" jdbcType="VARCHAR" property="mailMobile" />
|
||||
<result column="bank_account" jdbcType="VARCHAR" property="bankAccount" />
|
||||
<result column="bank_opening" jdbcType="VARCHAR" property="bankOpening" />
|
||||
<result column="refund_account" jdbcType="VARCHAR" property="refundAccount" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
</resultMap>
|
||||
|
||||
<update id="insertOrUpdateMailAddress" parameterType="com.cool.store.request.close.file.CloseStoreMailAddressRequest">
|
||||
INSERT INTO zxjp_close_store_file_detail
|
||||
(close_store_id, mail_address, mail_addressee, mail_mobile)
|
||||
VALUES
|
||||
(#{closeStoreId}, #{mailAddress}, #{mailAddressee}, #{mailMobile})
|
||||
ON DUPLICATE KEY UPDATE
|
||||
mail_address = VALUES(mail_address),
|
||||
mail_addressee = VALUES(mail_addressee),
|
||||
mail_mobile = VALUES(mail_mobile)
|
||||
</update>
|
||||
|
||||
<update id="insertOrUpdateMailInfo" parameterType="com.cool.store.request.close.file.CloseStoreMailInfoRequest">
|
||||
INSERT INTO zxjp_close_store_file_detail
|
||||
(close_store_id, mail_number, mail_company, mail_status)
|
||||
VALUES
|
||||
(#{request.closeStoreId}, #{request.mailNumber}, #{request.mailCompany}, #{mailStatus})
|
||||
ON DUPLICATE KEY UPDATE
|
||||
mail_number = VALUES(mail_number),
|
||||
mail_company = VALUES(mail_company),
|
||||
mail_status = VALUES(mail_status)
|
||||
</update>
|
||||
|
||||
<update id="insertOrUpdateFileInfoSelective">
|
||||
INSERT INTO zxjp_close_store_file_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="request.closeStoreId != null">close_store_id,</if>
|
||||
<if test="request.bankAccount != null">bank_account,</if>
|
||||
<if test="request.bankOpening != null">bank_opening,</if>
|
||||
<if test="request.refundAccount != null">refund_account,</if>
|
||||
<if test="approveComplete != null">approve_complete,</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="request.closeStoreId != null">#{request.closeStoreId},</if>
|
||||
<if test="request.bankAccount != null">#{request.bankAccount},</if>
|
||||
<if test="request.bankOpening != null">#{request.bankOpening},</if>
|
||||
<if test="request.refundAccount != null">#{request.refundAccount},</if>
|
||||
<if test="approveComplete != null">#{approveComplete},</if>
|
||||
</trim>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
<trim suffixOverrides=",">
|
||||
<if test="request.bankAccount != null">bank_account = VALUES(bank_account),</if>
|
||||
<if test="request.bankOpening != null">bank_opening = VALUES(bank_opening),</if>
|
||||
<if test="request.refundAccount != null">refund_account = VALUES(refund_account),</if>
|
||||
<if test="approveComplete != null">approve_complete = VALUES(approve_complete),</if>
|
||||
</trim>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.CloseStoreFileInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.CloseStoreFileInfoDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="close_store_id" jdbcType="BIGINT" property="closeStoreId" />
|
||||
<result column="file_code" jdbcType="VARCHAR" property="fileCode" />
|
||||
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
|
||||
<result column="mail_status" jdbcType="INTEGER" property="mailStatus" />
|
||||
<result column="approve_status" jdbcType="INTEGER" property="approveStatus" />
|
||||
<result column="approve_opinion" jdbcType="INTEGER" property="approveOpinion" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="urls" jdbcType="VARCHAR" property="urls" />
|
||||
<result column="file_status" jdbcType="TINYINT" property="fileStatus" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
UPDATE zxjp_close_store_file_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<trim prefix="mail_status = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.mailStatus}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="approve_status = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.approveStatus}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="approve_opinion = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.approveOpinion}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_close_store_file_info (close_store_id, file_code, file_name, mail_status, approve_status, approve_opinion)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.closeStoreId}, #{item.fileCode}, #{item.fileName}, #{item.mailStatus}, #{item.approveStatus}, #{item.approveOpinion})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateFile">
|
||||
UPDATE zxjp_close_store_file_info
|
||||
SET urls = #{urls},
|
||||
file_status = CASE WHEN file_status = 2 THEN 5 WHEN file_status = 5 THEN 5 ELSE 3 END
|
||||
WHERE id = #{id} AND file_status IN (0, 2, 3, 5)
|
||||
</update>
|
||||
|
||||
<update id="updateFileStatusToApproveStatus">
|
||||
UPDATE zxjp_close_store_file_info
|
||||
SET file_status = approve_status
|
||||
WHERE close_store_id = #{closeStoreId}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.CloseStoreInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.CloseStoreInfoDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="close_store_no" jdbcType="VARCHAR" property="closeStoreNo" />
|
||||
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
|
||||
<result column="region_id" jdbcType="BIGINT" property="regionId" />
|
||||
<result column="plan_close_data" jdbcType="DATE" property="planCloseData" />
|
||||
<result column="actual_close_data" jdbcType="DATE" property="actualCloseData" />
|
||||
<result column="close_type" jdbcType="TINYINT" property="closeType" />
|
||||
<result column="close_reason" jdbcType="TINYINT" property="closeReason" />
|
||||
<result column="reason_description" jdbcType="VARCHAR" property="reasonDescription" />
|
||||
<result column="close_status" jdbcType="TINYINT" property="closeStatus" />
|
||||
<result column="supervisor_user_id" jdbcType="VARCHAR" property="supervisorUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getCloseStoreInfoList" parameterType="java.util.List" resultType="com.cool.store.vo.close.store.CloseStoreInfoListVO">
|
||||
SELECT b.id close_store_id, b.plan_close_data, b.close_type, b.close_status, b.close_store_no, b.store_id
|
||||
, c.store_name, c.store_num, c.join_brand, c.store_address
|
||||
<if test="request.querySigner">
|
||||
, d.signer1_name, d.signer1_mobile, d.signer2_name, d.signer2_mobile
|
||||
</if>
|
||||
FROM zxjp_close_store_info b
|
||||
LEFT JOIN store_${enterpriseId} c ON b.store_id = c.store_id
|
||||
<if test="request.querySigner">
|
||||
LEFT JOIN store_master_signer_info_${enterpriseId} d ON b.store_id = d.store_id
|
||||
</if>
|
||||
<where>
|
||||
<if test="request.closeType != null">
|
||||
AND b.close_type = #{request.closeType}
|
||||
</if>
|
||||
<if test="request.closeStatus != null">
|
||||
<choose>
|
||||
<when test="request.closeStatus == 1">
|
||||
AND (b.close_status = 1 OR b.close_status = 2)
|
||||
</when>
|
||||
<otherwise>
|
||||
AND b.close_status = #{request.closeStatus}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="request.closeStoreNo != null and request.closeStoreNo != ''">
|
||||
AND b.close_store_no LIKE CONCAT('%', #{request.closeStoreNo}, '%')
|
||||
</if>
|
||||
<if test="request.storeNameOrNum != null and request.storeNameOrNum != ''">
|
||||
AND (c.store_name LIKE CONCAT('%', #{request.storeNameOrNum}, '%') OR c.store_num LIKE CONCAT('%', #{request.storeNameOrNum}, '%'))
|
||||
</if>
|
||||
<if test="request.joinBrands != null and !request.joinBrands.isEmpty()">
|
||||
AND c.join_brand IN
|
||||
<foreach item="item" collection="request.joinBrands" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.querySigner and request.signerName != null and request.signerName != ''">
|
||||
AND (d.signer1_name LIKE CONCAT('%', #{request.signerName}, '%') OR d.signer2_name LIKE CONCAT('%', #{request.signerName}, '%'))
|
||||
</if>
|
||||
<if test="request.querySigner and request.signerMobile != null and request.signerMobile != ''">
|
||||
AND (d.signer1_mobile LIKE CONCAT('%', #{request.signerMobile}, '%') OR d.signer2_mobile LIKE CONCAT('%', #{request.signerMobile}, '%'))
|
||||
</if>
|
||||
<if test="regionIds != null and !regionIds.isEmpty()">
|
||||
AND <foreach collection="regionIds" item="regionId" separator=" OR " open="(" close=")">
|
||||
c.region_path LIKE CONCAT('%', #{regionId}, '%')
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY b.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.CloseStoreRefundInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.CloseStoreRefundInfoDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="close_store_id" jdbcType="BIGINT" property="closeStoreId" />
|
||||
<result column="refund_no" jdbcType="VARCHAR" property="refundNo" />
|
||||
<result column="type" jdbcType="INTEGER" property="type" />
|
||||
<result column="refund_status" jdbcType="BIT" property="refundStatus" />
|
||||
<result column="refund_order_no" jdbcType="VARCHAR" property="refundOrderNo" />
|
||||
<result column="refund_time" jdbcType="TIMESTAMP" property="refundTime" />
|
||||
<result column="invoice_title" jdbcType="VARCHAR" property="invoiceTitle" />
|
||||
<result column="submitter_id" jdbcType="VARCHAR" property="submitterId" />
|
||||
<result column="submitter_name" jdbcType="VARCHAR" property="submitterName" />
|
||||
<result column="refund_reason" jdbcType="VARCHAR" property="refundReason" />
|
||||
<result column="refund_type" jdbcType="VARCHAR" property="refundType" />
|
||||
<result column="refund_project" jdbcType="VARCHAR" property="refundProject" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="business_code" jdbcType="VARCHAR" property="businessCode" />
|
||||
<result column="business_name" jdbcType="VARCHAR" property="businessName" />
|
||||
<result column="business_account" jdbcType="VARCHAR" property="businessAccount" />
|
||||
<result column="expense_type_code" jdbcType="VARCHAR" property="expenseTypeCode" />
|
||||
<result column="expense_apply_time" jdbcType="DATE" property="expenseApplyTime" />
|
||||
<result column="expected_amount" jdbcType="DECIMAL" property="expectedAmount" />
|
||||
<result column="actual_amount" jdbcType="DECIMAL" property="actualAmount" />
|
||||
<result column="deduct_amount" jdbcType="DECIMAL" property="deductAmount" />
|
||||
<result column="deduct_reason" jdbcType="VARCHAR" property="deductReason" />
|
||||
<result column="close_reason" jdbcType="TINYINT" property="closeReason" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="account_number" jdbcType="VARCHAR" property="accountNumber" />
|
||||
<result column="bank_name" jdbcType="VARCHAR" property="bankName" />
|
||||
<result column="bank_branch_no" jdbcType="VARCHAR" property="bankBranchNo" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_close_store_refund_info (
|
||||
close_store_id,
|
||||
refund_no,
|
||||
type,
|
||||
refund_status,
|
||||
refund_order_no,
|
||||
refund_time,
|
||||
invoice_title,
|
||||
submitter_id,
|
||||
submitter_name,
|
||||
refund_reason,
|
||||
refund_type,
|
||||
refund_project,
|
||||
remark,
|
||||
business_code,
|
||||
business_name,
|
||||
business_account,
|
||||
expense_type_code,
|
||||
expense_apply_time,
|
||||
expected_amount,
|
||||
actual_amount,
|
||||
deduct_amount,
|
||||
deduct_reason,
|
||||
close_reason,
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.closeStoreId,jdbcType=BIGINT},
|
||||
#{item.refundNo,jdbcType=VARCHAR},
|
||||
#{item.type,jdbcType=INTEGER},
|
||||
#{item.refundStatus,jdbcType=BIT},
|
||||
#{item.refundOrderNo,jdbcType=VARCHAR},
|
||||
#{item.refundTime,jdbcType=TIMESTAMP},
|
||||
#{item.invoiceTitle,jdbcType=VARCHAR},
|
||||
#{item.submitterId,jdbcType=VARCHAR},
|
||||
#{item.submitterName,jdbcType=VARCHAR},
|
||||
#{item.refundReason,jdbcType=VARCHAR},
|
||||
#{item.refundType,jdbcType=VARCHAR},
|
||||
#{item.refundProject,jdbcType=VARCHAR},
|
||||
#{item.remark,jdbcType=VARCHAR},
|
||||
#{item.businessCode,jdbcType=VARCHAR},
|
||||
#{item.businessName,jdbcType=VARCHAR},
|
||||
#{item.businessAccount,jdbcType=VARCHAR},
|
||||
#{item.expenseTypeCode,jdbcType=VARCHAR},
|
||||
#{item.expenseApplyTime,jdbcType=DATE},
|
||||
#{item.expectedAmount,jdbcType=DECIMAL},
|
||||
#{item.actualAmount,jdbcType=DECIMAL},
|
||||
#{item.deductAmount,jdbcType=DECIMAL},
|
||||
#{item.deductReason,jdbcType=VARCHAR},
|
||||
#{item.closeReason,jdbcType=TINYINT},
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateRefundStatusBatchById" parameterType="java.util.List">
|
||||
UPDATE zxjp_close_store_refund_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<trim prefix="refund_status = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.refundStatus}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.CloseStoreStageInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.CloseStoreStageInfoDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="close_store_id" jdbcType="BIGINT" property="closeStoreId" />
|
||||
<result column="shop_stage" jdbcType="TINYINT" property="shopStage" />
|
||||
<result column="shop_sub_stage" jdbcType="INTEGER" property="shopSubStage" />
|
||||
<result column="shop_sub_stage_status" jdbcType="INTEGER" property="shopSubStageStatus" />
|
||||
<result column="is_terminated" jdbcType="BIT" property="isTerminated" />
|
||||
<result column="plan_complete_time" jdbcType="VARCHAR" property="planCompleteTime" />
|
||||
<result column="actual_complete_time" jdbcType="VARCHAR" property="actualCompleteTime" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="audit_id" jdbcType="BIGINT" property="auditId" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_close_store_stage_info (close_store_id, shop_stage, shop_sub_stage, shop_sub_stage_status, is_terminated, plan_complete_time, actual_complete_time, remark, audit_id)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.closeStoreId}, #{item.shopStage}, #{item.shopSubStage}, #{item.shopSubStageStatus}, #{item.isTerminated}, #{item.planCompleteTime}, #{item.actualCompleteTime}, #{item.remark}, #{item.auditId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateBatchSelective" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
UPDATE zxjp_close_store_stage_info
|
||||
<set>
|
||||
<if test="item.shopStage != null">
|
||||
shop_stage = #{item.shopStage},
|
||||
</if>
|
||||
<if test="item.shopSubStage != null">
|
||||
shop_sub_stage = #{item.shopSubStage},
|
||||
</if>
|
||||
<if test="item.shopSubStageStatus != null">
|
||||
shop_sub_stage_status = #{item.shopSubStageStatus},
|
||||
</if>
|
||||
<if test="item.isTerminated != null">
|
||||
is_terminated = #{item.isTerminated},
|
||||
</if>
|
||||
<if test="item.planCompleteTime != null and item.planCompleteTime != ''">
|
||||
plan_complete_time = #{item.planCompleteTime},
|
||||
</if>
|
||||
<if test="item.actualCompleteTime != null and item.actualCompleteTime != ''">
|
||||
actual_complete_time = #{item.actualCompleteTime},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.auditId != null">
|
||||
audit_id = #{item.auditId},
|
||||
</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -285,4 +285,46 @@
|
||||
ON DUPLICATE KEY UPDATE
|
||||
score = values(score)
|
||||
</insert>
|
||||
|
||||
<update id="updateStoreStatus">
|
||||
UPDATE store_${enterpriseId}
|
||||
SET store_status = #{storeStatus}
|
||||
WHERE store_id = #{storeId} AND is_delete = 'effective'
|
||||
</update>
|
||||
|
||||
<update id="closeStore">
|
||||
UPDATE store_${enterpriseId}
|
||||
SET store_status = 'closed',
|
||||
close_store_time = #{actualCloseData}
|
||||
WHERE store_id = #{storeId} AND is_delete = 'effective' AND store_status != 'closed'
|
||||
</update>
|
||||
|
||||
<insert id="insertOrUpdateCloseInfo">
|
||||
INSERT INTO store_extend_info_${enterpriseId}(store_id, close_reason, close_nature)
|
||||
VALUES(#{storeId}, #{closeReason}, #{closeNature})
|
||||
ON DUPLICATE KEY UPDATE
|
||||
close_reason = VALUES(close_reason),
|
||||
close_nature = VALUES(close_nature)
|
||||
</insert>
|
||||
|
||||
<select id="getNoOrderStore" resultType="com.cool.store.entity.StoreDO">
|
||||
SELECT * FROM store_${enterpriseId} a
|
||||
LEFT JOIN store_extend_info_${enterpriseId} b ON a.store_id = b.store_id
|
||||
WHERE a.is_delete = 'effective' AND a.store_status != 'closed'
|
||||
AND b.latest_order_time IS NOT NULL AND b.latest_order_time < #{latestDate}
|
||||
<choose>
|
||||
<when test="inBusinessType != null and inBusinessType">
|
||||
AND b.business_type IN
|
||||
<foreach item="item" collection="businessTypes" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
AND (b.business_type IS NULL OR b.business_type NOT IN
|
||||
<foreach item="item" collection="businessTypes" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>)
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user