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,48 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreAccountService;
|
||||
import com.cool.store.vo.close.account.CloseStoreAccountVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店账号关闭 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/8
|
||||
*/
|
||||
@Api(tags = "闭店账号关闭")
|
||||
@RestController
|
||||
@RequestMapping("/pc/close/account")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class CloseStoreAccountController {
|
||||
private final CloseStoreAccountService closeStoreAccountService;
|
||||
|
||||
@ApiOperation("获取账号列表")
|
||||
@GetMapping("/accountList")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long")
|
||||
public ResponseResult<List<CloseStoreAccountVO>> accountList(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreAccountService.getAccountList(closeStoreId));
|
||||
}
|
||||
|
||||
@ApiOperation("账号关闭")
|
||||
@PostMapping("/accountClose")
|
||||
@ApiImplicitParam(name = "id", value = "列表接口中返回的id", required = true, dataType = "Long")
|
||||
public ResponseResult<Boolean> accountClose(@NotNull(message = "id不能为空") Long id) {
|
||||
return ResponseResult.success(closeStoreAccountService.closeAccount(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.request.close.store.CloseStoreQueryRequest;
|
||||
import com.cool.store.request.close.store.CloseStoreAuditRequest;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreService;
|
||||
import com.cool.store.vo.close.store.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店审批 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/9
|
||||
*/
|
||||
@Api(tags = "闭店管理")
|
||||
@RestController
|
||||
@RequestMapping("/pc/close/store")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class CloseStoreController {
|
||||
private final CloseStoreService closeStoreService;
|
||||
|
||||
@ApiOperation("闭店审批待办")
|
||||
@GetMapping("/todoPage")
|
||||
public ResponseResult<PageInfo<CloseStoreInfoListVO>> getAuditTodoList(CloseStoreQueryRequest request) {
|
||||
return ResponseResult.success(closeStoreService.closeStoreAuditList(request));
|
||||
}
|
||||
|
||||
@ApiOperation("闭店管理列表")
|
||||
@GetMapping("/recordPage")
|
||||
public ResponseResult<PageInfo<CloseStoreInfoListVO>> getCloseStoreRecordList(CloseStoreQueryRequest request) {
|
||||
return ResponseResult.success(closeStoreService.closeStoreInfoList(request));
|
||||
}
|
||||
|
||||
@ApiOperation("审批通过")
|
||||
@PostMapping("/audit/pass")
|
||||
public ResponseResult<Boolean> auditPass(@RequestBody CloseStoreAuditRequest request) {
|
||||
return ResponseResult.success(closeStoreService.auditPass(request));
|
||||
}
|
||||
|
||||
@ApiOperation("审批拒绝")
|
||||
@PostMapping("/audit/reject")
|
||||
public ResponseResult<Boolean> auditReject(@RequestBody CloseStoreAuditRequest request) {
|
||||
return ResponseResult.success(closeStoreService.auditReject(request));
|
||||
}
|
||||
|
||||
@ApiOperation("查询闭店审批记录")
|
||||
@GetMapping("/audit/list")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<List<AuditInfoResponse>> getAuditList(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreService.getAuditRecordList(closeStoreId));
|
||||
}
|
||||
|
||||
@ApiOperation("根据闭店申请id获取闭店申请详细")
|
||||
@GetMapping("/detail")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<CloseStoreInfoDetailVO> getCloseStoreDetail(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreService.getCloseStoreInfoDetail(closeStoreId, true));
|
||||
}
|
||||
|
||||
@ApiOperation("根据闭店申请id获取闭店申请简单信息")
|
||||
@GetMapping("/simple")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<CloseStoreSimpleVO> getCloseStoreSimple(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreService.getCloseStoreSimpleInfo(closeStoreId));
|
||||
}
|
||||
|
||||
@ApiOperation("根据审批id获取闭店申请详细")
|
||||
@GetMapping("/detailByAudit")
|
||||
@ApiImplicitParam(name = "closeStoreAuditId", value = "审批id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<CloseStoreInfoDetailVO> getCloseStoreDetailByAuditId(@NotNull(message = "审批id不能为空") Long closeStoreAuditId) {
|
||||
return ResponseResult.success(closeStoreService.getCloseStoreInfoDetailByAuditId(closeStoreAuditId));
|
||||
}
|
||||
|
||||
@ApiOperation("闭店原因列表")
|
||||
@GetMapping("/closeReasonList")
|
||||
@ApiImplicitParam(name = "closeType", value = "闭店发起方式,1主动发起,2云流水发起", required = true, dataType = "Integer", paramType = "query")
|
||||
public ResponseResult<List<StoreCloseReasonVO>> getStoreCloseReasonList(Integer closeType) {
|
||||
return ResponseResult.success(closeStoreService.getStoreCloseReasonList(closeType));
|
||||
}
|
||||
|
||||
@ApiOperation("闭店状态列表")
|
||||
@GetMapping("/closeStatusList")
|
||||
public ResponseResult<List<CloseStoreStatusVO>> getCloseStoreStatusList() {
|
||||
return ResponseResult.success(closeStoreService.getCloseStoreStatusList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.request.close.file.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreFileService;
|
||||
import com.cool.store.vo.close.file.CloseStoreFileDetailVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店材料 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/7
|
||||
*/
|
||||
@Api(tags = "闭店材料")
|
||||
@RestController
|
||||
@RequestMapping("/pc/close/file")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class CloseStoreFileController {
|
||||
private final CloseStoreFileService closeStoreFileService;
|
||||
|
||||
@ApiOperation("更新材料邮寄地址")
|
||||
@PostMapping("/updateMailAddress")
|
||||
public ResponseResult<Boolean> updateMailAddress(@RequestBody @Valid CloseStoreMailAddressRequest request) {
|
||||
return ResponseResult.success(closeStoreFileService.updateMailAddress(request));
|
||||
}
|
||||
|
||||
@ApiOperation("查询闭店材料详情")
|
||||
@GetMapping("/detail")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long")
|
||||
public ResponseResult<CloseStoreFileDetailVO> getFileDetail(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreFileService.getFileDetail(closeStoreId));
|
||||
}
|
||||
|
||||
@ApiOperation("提交材料")
|
||||
@PostMapping("/submitFile")
|
||||
public ResponseResult<Boolean> submitFile(@RequestBody @Valid CloseStoreMailInfoRequest request) {
|
||||
return ResponseResult.success(closeStoreFileService.submitFile(request));
|
||||
}
|
||||
|
||||
@ApiOperation("修改单个材料")
|
||||
@PostMapping("/updateFile")
|
||||
public ResponseResult<Boolean> updateFile(@RequestBody @Valid CloseStoreFileSubmitRequest request) {
|
||||
return ResponseResult.success(closeStoreFileService.updateFile(request));
|
||||
}
|
||||
|
||||
@ApiOperation("单个材料提交审批")
|
||||
@PostMapping("/submitFileApproveSingle")
|
||||
public ResponseResult<Boolean> submitFileApproveSingle(@RequestBody @Valid CloseStoreFileInfoRequest request) {
|
||||
return ResponseResult.success(closeStoreFileService.submitFileApproveSingle(request));
|
||||
}
|
||||
|
||||
@ApiOperation("督导审批")
|
||||
@PostMapping("/supervisionAudit")
|
||||
public ResponseResult<Boolean> supervisionAudit(@RequestBody @Valid CloseStoreFileAuditRequest request) {
|
||||
return ResponseResult.success(closeStoreFileService.supervisionAudit(request));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.close.CloseStoreMkUserDTO;
|
||||
import com.cool.store.request.close.refund.CloseStoreRefundAddRequest;
|
||||
import com.cool.store.request.close.refund.CloseStoreRefundQueryRequest;
|
||||
import com.cool.store.request.close.refund.CloseStoreRefundSkipRequest;
|
||||
import com.cool.store.request.close.refund.CloseStoreRefundUpdateRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreRefundService;
|
||||
import com.cool.store.vo.close.refund.CloseStoreRefundDetailVO;
|
||||
import com.cool.store.vo.close.refund.CloseStoreRefundListVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店退款 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/13
|
||||
*/
|
||||
@Api(tags = "闭店退款")
|
||||
@RestController
|
||||
@RequestMapping("/pc/close/refund")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class CloseStoreRefundController {
|
||||
private final CloseStoreRefundService closeStoreRefundService;
|
||||
|
||||
@ApiOperation("获取当前用户的每刻用户信息")
|
||||
@GetMapping("/getCurrentMkUser")
|
||||
public ResponseResult<CloseStoreMkUserDTO> getCurrentMkUser() {
|
||||
return ResponseResult.success(closeStoreRefundService.getCurrentMkUser());
|
||||
}
|
||||
|
||||
@ApiOperation("获取退款详细信息")
|
||||
@GetMapping("/detail")
|
||||
@ApiImplicitParam(name = "id", value = "退款信息id", required = true, dataType = "Long")
|
||||
public ResponseResult<CloseStoreRefundDetailVO> detail(@NotNull(message = "退款信息id不能为空") Long id) {
|
||||
return ResponseResult.success(closeStoreRefundService.getRefundDetail(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增退款信息")
|
||||
@PostMapping("/addRefund")
|
||||
public ResponseResult<Boolean> addRefund(@RequestBody @Valid CloseStoreRefundAddRequest request) {
|
||||
return ResponseResult.success(closeStoreRefundService.addRefund(request));
|
||||
}
|
||||
|
||||
@ApiOperation("编辑退款信息")
|
||||
@PostMapping("/updateRefund")
|
||||
public ResponseResult<Boolean> updateRefund(@RequestBody @Valid CloseStoreRefundUpdateRequest request) {
|
||||
return ResponseResult.success(closeStoreRefundService.updateRefund(request));
|
||||
}
|
||||
|
||||
@ApiOperation("跳过")
|
||||
@PostMapping("/skip")
|
||||
public ResponseResult<Boolean> skip(@RequestBody @Validated CloseStoreRefundSkipRequest request) {
|
||||
closeStoreRefundService.skip(request);
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("退款信息列表")
|
||||
@GetMapping("/refundPage")
|
||||
public ResponseResult<PageInfo<CloseStoreRefundListVO>> refundPage(@Validated CloseStoreRefundQueryRequest request) {
|
||||
return ResponseResult.success(closeStoreRefundService.refundPage(request));
|
||||
}
|
||||
|
||||
@ApiOperation("退款状态刷新")
|
||||
@PostMapping("/refresh")
|
||||
public ResponseResult<Boolean> refresh(@RequestBody @Validated CloseStoreRefundQueryRequest request) {
|
||||
return ResponseResult.success(closeStoreRefundService.refreshRefundOrderStatus(request));
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -33,6 +34,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("pc/sys/dict")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class DictManagerController {
|
||||
private final DictGroupService groupService;
|
||||
private final DictTableInfoService tableService;
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.store.StoreUserPositionDTO;
|
||||
import com.cool.store.dto.wallet.PaymentDTO;
|
||||
import com.cool.store.dto.wx.MiniProgramFreeLoginDTO;
|
||||
import com.cool.store.handler.WeChatHandler;
|
||||
import com.cool.store.enums.close.CloseTypeEnum;
|
||||
import com.cool.store.request.OpenApiStoreRequest;
|
||||
import com.cool.store.request.StoreCodeDTO;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.request.close.store.ThirdCloseStoreApplyRequest;
|
||||
import com.cool.store.request.notice.ThirdHandleMessageRequest;
|
||||
import com.cool.store.request.notice.ThirdMatterRequest;
|
||||
import com.cool.store.request.wallet.AccountTradeCallbackRequest;
|
||||
@@ -17,11 +18,11 @@ import com.cool.store.request.wallet.AddTagCallbackNoticeRequest;
|
||||
import com.cool.store.request.wallet.OnlineCommercialBankCallbackRequest;
|
||||
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
|
||||
import com.cool.store.request.xgj.ReceiptCallBackRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.bigdata.ApiResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.wallet.WalletService;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.service.close.CloseStoreService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -64,6 +65,8 @@ public class OpenApiController {
|
||||
WeChatHandler weChatHandler;
|
||||
@Resource
|
||||
WalletService walletService;
|
||||
@Resource
|
||||
CloseStoreService closeStoreService;
|
||||
|
||||
@PostMapping("/statusRefresh")
|
||||
public ApiResponse<Boolean> statusRefresh(@RequestBody StatusRefreshDTO statusRefreshDTO){
|
||||
|
||||
@@ -7,7 +7,10 @@ import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.contract.ContractCallbackDTO;
|
||||
import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.huoma.*;
|
||||
import com.cool.store.dto.xgj.XgjBranchBankDTO;
|
||||
import com.cool.store.dto.xgj.XgjPartnerPageDTO;
|
||||
import com.cool.store.dto.wallet.*;
|
||||
import com.cool.store.dto.xgj.XgjPayResultDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.DownSystemTypeEnum;
|
||||
import com.cool.store.enums.FranchiseBrandEnum;
|
||||
@@ -23,10 +26,12 @@ import com.cool.store.mapper.SignFranchiseMapper;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.request.bigdata.ProfitDataRequest;
|
||||
import com.cool.store.request.close.store.CloseStoreApplyRequest;
|
||||
import com.cool.store.request.huoma.ShopBasicInfoRequest;
|
||||
import com.cool.store.request.oppty.*;
|
||||
import com.cool.store.request.wallet.*;
|
||||
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
|
||||
import com.cool.store.request.xgj.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.bigdata.ActDataResponse;
|
||||
import com.cool.store.response.bigdata.ApiResponse;
|
||||
@@ -37,6 +42,7 @@ import com.cool.store.response.oppty.CityResponse;
|
||||
import com.cool.store.response.oppty.OpportunityDetailResponse;
|
||||
import com.cool.store.response.oppty.OpportunityInfoPageResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.close.CloseStoreService;
|
||||
import com.cool.store.service.impl.CommonService;
|
||||
import com.cool.store.service.impl.UserAuthMappingServiceImpl;
|
||||
import com.cool.store.service.wallet.WalletApiService;
|
||||
@@ -112,6 +118,46 @@ public class PCTestController {
|
||||
|
||||
@Autowired
|
||||
WeChatHandler weChatHandler;
|
||||
@Resource
|
||||
ThirdXgjService thirdXgjService;
|
||||
@Resource
|
||||
CloseStoreService closeStoreService;
|
||||
|
||||
@PostMapping("/applyCloseStore")
|
||||
public ResponseResult<Boolean> applyCloseStore(@RequestBody @Valid CloseStoreApplyRequest request) {
|
||||
return ResponseResult.success(closeStoreService.applyCloseStore(request));
|
||||
}
|
||||
|
||||
@PostMapping("/reimburse")
|
||||
public ResponseResult<String> reimburse(@RequestBody XgjReimburseRequest request) {
|
||||
return ResponseResult.success(thirdXgjService.reimburse(request));
|
||||
}
|
||||
|
||||
@PostMapping("/savePartner")
|
||||
public ResponseResult<String> savePartner(@RequestBody XgjSavePartnerRequest request) {
|
||||
return ResponseResult.success(thirdXgjService.savePartner(request));
|
||||
}
|
||||
|
||||
@PostMapping("/queryOrderStatus")
|
||||
public ResponseResult<XgjPayResultDTO> queryOrderStatus(@RequestBody XgjPaymentRequest request) {
|
||||
return ResponseResult.success(thirdXgjService.queryOrderStatus(request));
|
||||
}
|
||||
|
||||
@PostMapping("/queryPartnerPage")
|
||||
public ResponseResult<XgjPartnerPageDTO> queryPartnerPage(@RequestBody XgjPartnerQueryRequest request) {
|
||||
return ResponseResult.success(thirdXgjService.queryPartnerPage(request));
|
||||
}
|
||||
|
||||
@PostMapping("/queryBranchBankList")
|
||||
public ResponseResult<List<XgjBranchBankDTO>> queryBranchBankList(@RequestBody XgjBankQueryRequest request) {
|
||||
return ResponseResult.success(thirdXgjService.queryBranchBankList(request));
|
||||
}
|
||||
|
||||
@PostMapping("/accountClose")
|
||||
public ResponseResult<String> accountClose(@RequestBody XgjAccountCloseRequest request) {
|
||||
return ResponseResult.success(thirdXgjService.accountClose(request));
|
||||
}
|
||||
|
||||
@GetMapping("/syncStore")
|
||||
public ResponseResult<Boolean> syncStore(@RequestParam("shopId")Long shopId){
|
||||
syncMainSysServer.syncStore(shopId);
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreAccountService;
|
||||
import com.cool.store.vo.close.account.CloseStoreAccountVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店账号关闭 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/8
|
||||
*/
|
||||
@Api(tags = "mini账号关闭")
|
||||
@RestController
|
||||
@RequestMapping("/mini/close/account")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class MiniCloseStoreAccountController {
|
||||
private final CloseStoreAccountService closeStoreAccountService;
|
||||
|
||||
@ApiOperation("获取账号列表")
|
||||
@GetMapping("/accountList")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long")
|
||||
public ResponseResult<List<CloseStoreAccountVO>> accountList(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreAccountService.getAccountList(closeStoreId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.enums.close.CloseTypeEnum;
|
||||
import com.cool.store.request.close.store.CloseStoreApplyRequest;
|
||||
import com.cool.store.request.close.store.CloseStoreCancelRequest;
|
||||
import com.cool.store.request.close.store.MiniCloseStoreQueryRequest;
|
||||
import com.cool.store.request.close.store.ReCloseStoreApplyRequest;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreService;
|
||||
import com.cool.store.vo.close.store.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店审批 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/9
|
||||
*/
|
||||
@Api(tags = "mini闭店管理")
|
||||
@RestController
|
||||
@RequestMapping("/mini/close/store")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class MiniCloseStoreController {
|
||||
private final CloseStoreService closeStoreService;
|
||||
|
||||
@ApiOperation("申请闭店")
|
||||
@PostMapping("/apply")
|
||||
public ResponseResult<Boolean> applyCloseStore(@RequestBody @Valid CloseStoreApplyRequest request) {
|
||||
request.setCloseType(CloseTypeEnum.INITIATE.getCloseType());
|
||||
return ResponseResult.success(closeStoreService.applyCloseStore(request));
|
||||
}
|
||||
|
||||
@ApiOperation("拒绝后重新提交申请闭店")
|
||||
@PostMapping("/reapply")
|
||||
public ResponseResult<Boolean> reApplyCloseStore(@RequestBody @Valid ReCloseStoreApplyRequest request) {
|
||||
return ResponseResult.success(closeStoreService.reApplyCloseStore(request));
|
||||
}
|
||||
|
||||
@ApiOperation("闭店申请列表")
|
||||
@GetMapping("/page")
|
||||
public ResponseResult<PageInfo<MiniCloseStoreSimpleVO>> closeStorePage(MiniCloseStoreQueryRequest request) {
|
||||
return ResponseResult.success(closeStoreService.getMiniCloseStoreSimpleInfoList(request));
|
||||
}
|
||||
|
||||
@ApiOperation("查询闭店审批记录")
|
||||
@GetMapping("/audit/list")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<List<AuditInfoResponse>> getAuditList(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreService.getAuditRecordList(closeStoreId));
|
||||
}
|
||||
|
||||
@ApiOperation("闭店原因列表")
|
||||
@GetMapping("/closeReasonList")
|
||||
@ApiImplicitParam(name = "closeType", value = "闭店发起方式,1主动发起,2云流水发起", required = true, dataType = "Integer", paramType = "query")
|
||||
public ResponseResult<List<StoreCloseReasonVO>> getStoreCloseReasonList(Integer closeType) {
|
||||
return ResponseResult.success(closeStoreService.getStoreCloseReasonList(closeType));
|
||||
}
|
||||
|
||||
@ApiOperation("取消闭店申请")
|
||||
@PostMapping("/cancel")
|
||||
public ResponseResult<Boolean> cancelCloseStore(@RequestBody @Valid CloseStoreCancelRequest request) {
|
||||
return ResponseResult.success(closeStoreService.cancelApply(request.getCloseStoreId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.request.close.file.CloseStoreFileSubmitRequest;
|
||||
import com.cool.store.request.close.file.CloseStoreMailInfoRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreFileService;
|
||||
import com.cool.store.vo.close.file.CloseStoreFileDetailMiniVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 小程序闭店材料 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/7
|
||||
*/
|
||||
@Api(tags = "mini闭店材料")
|
||||
@RestController
|
||||
@RequestMapping("/mini/close/file")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class MiniCloseStoreFileController {
|
||||
private final CloseStoreFileService closeStoreFileService;
|
||||
|
||||
@ApiOperation("查询闭店材料详情")
|
||||
@GetMapping("/detail")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long")
|
||||
public ResponseResult<CloseStoreFileDetailMiniVO> getFileDetail(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreFileService.getMiniFileDetail(closeStoreId));
|
||||
}
|
||||
|
||||
@ApiOperation("提交材料")
|
||||
@PostMapping("/submitFile")
|
||||
public ResponseResult<Boolean> submitFile(@RequestBody @Valid CloseStoreMailInfoRequest request) {
|
||||
return ResponseResult.success(closeStoreFileService.submitFile(request));
|
||||
}
|
||||
|
||||
@ApiOperation("修改单个材料")
|
||||
@PostMapping("/updateFile")
|
||||
public ResponseResult<Boolean> updateFile(@RequestBody @Valid CloseStoreFileSubmitRequest request) {
|
||||
return ResponseResult.success(closeStoreFileService.updateFile(request));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.close.CloseStoreRefundService;
|
||||
import com.cool.store.vo.close.refund.CloseStoreRefundSimpleVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闭店退款 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/10/13
|
||||
*/
|
||||
@Api(tags = "mini闭店退款")
|
||||
@RestController
|
||||
@RequestMapping("/mini/close/refund")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class MiniCloseStoreRefundController {
|
||||
private final CloseStoreRefundService closeStoreRefundService;
|
||||
|
||||
@ApiOperation("退款信息列表")
|
||||
@GetMapping("/list")
|
||||
@ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long")
|
||||
public ResponseResult<List<CloseStoreRefundSimpleVO>> list(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
|
||||
return ResponseResult.success(closeStoreRefundService.getRefundSimpleList(closeStoreId));
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,8 @@ import com.cool.store.response.caipin.StoreUserResponse;
|
||||
import com.cool.store.response.xfsgFirstOderListResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.wallet.WalletService;
|
||||
import com.cool.store.service.close.CloseStoreAccountService;
|
||||
import com.cool.store.service.close.CloseStoreRefundService;
|
||||
import com.cool.store.utils.poi.ExcelUtil;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.RegionPathNameVO;
|
||||
@@ -49,10 +51,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -96,6 +95,11 @@ public class TestController {
|
||||
LinePayDAO linePayDAO;
|
||||
@Resource
|
||||
OpenApiService openApiService;
|
||||
@Resource
|
||||
private CloseStoreAccountService closeStoreAccountService;
|
||||
@Resource
|
||||
private CloseStoreRefundService closeStoreRefundService;
|
||||
|
||||
|
||||
@PostMapping("/testXgjCallback")
|
||||
public ResponseResult<Boolean> testXgjCallback(Long linePayId) {
|
||||
@@ -114,6 +118,18 @@ public class TestController {
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/completeRefund")
|
||||
public ResponseResult<Boolean> completeRefund(Long refundId) {
|
||||
closeStoreRefundService.completeRefund(refundId, new Date());
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/verifyAndUpdateAccountClose")
|
||||
public ResponseResult<Boolean> verifyAndUpdateAccountClose(Long closeStoreId) {
|
||||
closeStoreAccountService.verifyAndUpdateStage(closeStoreId);
|
||||
return ResponseResult.success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/getFirstOrders")
|
||||
public ResponseResult<xfsgFirstOderListResponse> getFirstOrders(@RequestBody xfsgFirstOrderListRequest storeCodeList) {
|
||||
xfsgFirstOderListResponse firstOrderList = coolStoreStartFlowService.getFirstOrderList(storeCodeList);
|
||||
|
||||
@@ -7,10 +7,15 @@ import com.cool.store.dao.*;
|
||||
import com.cool.store.dao.tp.TpApplyFormDAO;
|
||||
import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||
import com.cool.store.dto.xgj.XgjPayResultDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import com.cool.store.enums.close.CloseTypeEnum;
|
||||
import com.cool.store.enums.close.RefundPayStatusEnum;
|
||||
import com.cool.store.enums.close.XgjRefundPayStatusEnum;
|
||||
import com.cool.store.enums.master.StoreCloseReasonEnum;
|
||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.mapper.TrainingExperienceMapper;
|
||||
@@ -19,14 +24,20 @@ import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.request.bigdata.LatestOrderDateRequest;
|
||||
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||
import com.cool.store.request.close.store.CloseStoreApplyRequest;
|
||||
import com.cool.store.request.xgj.XgjPaymentRequest;
|
||||
import com.cool.store.response.bigdata.LatestOrderDateResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.close.CloseStoreRefundService;
|
||||
import com.cool.store.service.close.CloseStoreService;
|
||||
import com.cool.store.service.impl.CommonService;
|
||||
import com.cool.store.service.tp.TpApplyService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.MDCUtils;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -110,6 +121,14 @@ public class XxlJobHandler {
|
||||
TpApplyFormDAO tpApplyFormDAO;
|
||||
@Resource
|
||||
TpApplyService tpApplyService;
|
||||
@Resource
|
||||
CloseStoreService closeStoreService;
|
||||
@Resource
|
||||
CloseStoreRefundInfoDAO closeStoreRefundInfoDAO;
|
||||
@Resource
|
||||
ThirdXgjService thirdXgjService;
|
||||
@Resource
|
||||
CloseStoreRefundService closeStoreRefundService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -438,6 +457,68 @@ public class XxlJobHandler {
|
||||
log.info("------end latestOrderDate------");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学校店自动发起闭店
|
||||
*/
|
||||
@XxlJob("schoolStoreApplyClose")
|
||||
public void schoolStoreApplyClose() {
|
||||
MDCUtils.put(CommonConstants.REQUEST_ID, UUID.randomUUID().toString());
|
||||
log.info("------start schoolStoreApplyClose------");
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
String monthQueryLimit = "3";
|
||||
if (StringUtils.isNotBlank(param)) {
|
||||
monthQueryLimit = param;
|
||||
}
|
||||
autoApplyClose(monthQueryLimit, Arrays.asList("store_school_internal", "store_school_external"), true);
|
||||
log.info("------end schoolStoreApplyClose------");
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通店自动发起闭店
|
||||
*/
|
||||
@XxlJob("normalStoreApplyClose")
|
||||
public void normalStoreApplyClose() {
|
||||
MDCUtils.put(CommonConstants.REQUEST_ID, UUID.randomUUID().toString());
|
||||
log.info("------start normalStoreApplyClose------");
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
String monthQueryLimit = "1";
|
||||
if (StringUtils.isNotBlank(param)) {
|
||||
monthQueryLimit = param;
|
||||
}
|
||||
autoApplyClose(monthQueryLimit, Arrays.asList("store_school_internal", "store_school_external"), false);
|
||||
log.info("------end normalStoreApplyClose------");
|
||||
}
|
||||
|
||||
private void autoApplyClose(String monthQueryLimit, List<String> businessTypes, Boolean inBusinessType) {
|
||||
boolean hasNext = true;
|
||||
int pageNum = 1;
|
||||
int pageSize = CommonConstants.BATCH_SIZE;
|
||||
LocalDate latestDate = LocalDate.now().minusMonths(Long.parseLong(monthQueryLimit)).plusDays(1);
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<StoreDO> storeList = storeDao.getNoOrderStore(latestDate, businessTypes, inBusinessType);
|
||||
if (CollectionUtils.isEmpty(storeList)) {
|
||||
break;
|
||||
}
|
||||
hasNext = storeList.size() >= pageSize;
|
||||
for (StoreDO storeDO : storeList) {
|
||||
try {
|
||||
CloseStoreApplyRequest applyRequest = CloseStoreApplyRequest.builder()
|
||||
.planCloseDate(DateUtils.parseDate(LocalDate.now().plusMonths(1).toString()))
|
||||
.closeReason(StoreCloseReasonEnum.REASON0.getCode())
|
||||
.closeType(CloseTypeEnum.NO_ORDER_AUTO.getCloseType())
|
||||
.storeId(storeDO.getStoreId())
|
||||
.build();
|
||||
closeStoreService.applyCloseStore(applyRequest);
|
||||
} catch (Exception e) {
|
||||
log.info("自动闭店申请发起失败, storeId:{}, storeName:{}", storeDO.getStoreId(), storeDO.getStoreName());
|
||||
log.info("自动闭店申请发起失败", e);
|
||||
}
|
||||
}
|
||||
pageNum++;
|
||||
}
|
||||
}
|
||||
|
||||
public Date parseDate(LatestOrderDateResponse v, DateFormat format) {
|
||||
try {
|
||||
return format.parse(v.getLatest_buy_date());
|
||||
@@ -487,4 +568,71 @@ public class XxlJobHandler {
|
||||
}
|
||||
log.info("------end tpPenaltyAppealOverdue------");
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款订单状态更新
|
||||
*/
|
||||
@XxlJob("refundOrderStatus")
|
||||
public void refundOrderStatus() {
|
||||
MDCUtils.put(CommonConstants.REQUEST_ID, UUID.randomUUID().toString());
|
||||
log.info("------start refundOrderStatus------");
|
||||
boolean hasNext = true;
|
||||
int pageNum = 1;
|
||||
int pageSize = CommonConstants.BATCH_SIZE;
|
||||
List<CloseStoreRefundInfoDO> updateList = new ArrayList<>();
|
||||
List<CloseStoreRefundInfoDO> completeList = new ArrayList<>();
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<CloseStoreRefundInfoDO> list = closeStoreRefundInfoDAO.getUnfinishedRecords();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
break;
|
||||
}
|
||||
hasNext = list.size() >= pageSize;
|
||||
for (CloseStoreRefundInfoDO refundInfoDO : list) {
|
||||
try {
|
||||
if (StringUtils.isNotBlank(refundInfoDO.getRefundOrderNo())) {
|
||||
XgjPayResultDTO xgjPayResultDTO = thirdXgjService.queryOrderStatus(new XgjPaymentRequest(refundInfoDO.getRefundOrderNo()));
|
||||
String xgjStatus = xgjPayResultDTO.getStatus();
|
||||
String refundStatus = XgjRefundPayStatusEnum.REJECTED.getStatus().equals(xgjStatus) ? RefundPayStatusEnum.APPROVING.getStatus() : xgjStatus;
|
||||
if (!refundInfoDO.getRefundStatus().equals(refundStatus)) {
|
||||
CloseStoreRefundInfoDO update = CloseStoreRefundInfoDO.builder()
|
||||
.id(refundInfoDO.getId())
|
||||
.refundStatus(refundStatus)
|
||||
.refundTime(CoolDateUtils.parseDate(xgjPayResultDTO.getPaySuccessTime(), "yyyy-MM-dd HH:mm:ss"))
|
||||
.build();
|
||||
if (refundStatus.equals(RefundPayStatusEnum.PAY_SUCCESS.getStatus())) {
|
||||
completeList.add(update);
|
||||
} else {
|
||||
updateList.add(update);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("退款状态查询失败, refundId:{}", refundInfoDO.getId());
|
||||
log.info("退款状态查询失败", e);
|
||||
}
|
||||
}
|
||||
pageNum++;
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
for (List<CloseStoreRefundInfoDO> list : Lists.partition(updateList, CommonConstants.BATCH_SIZE)) {
|
||||
try {
|
||||
closeStoreRefundInfoDAO.updateRefundStatusBatchById(list);
|
||||
} catch (Exception e) {
|
||||
log.error("退款状态更新失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(completeList)) {
|
||||
for (CloseStoreRefundInfoDO refundInfoDO : completeList) {
|
||||
try {
|
||||
closeStoreRefundService.completeRefund(refundInfoDO.getId(), refundInfoDO.getRefundTime());
|
||||
} catch (Exception e) {
|
||||
log.error("退款状态更新失败, refundId:{}", refundInfoDO.getId());
|
||||
log.error("退款状态更新失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("------end refundOrderStatus------");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user