Commit 8a1ec79c by 程裕兵

feat:latest success apply

parent c0893fa1
...@@ -62,6 +62,10 @@ public interface StudioMerchantApi { ...@@ -62,6 +62,10 @@ public interface StudioMerchantApi {
@PostMapping(value = "/private/studioMerchant/getLatestApply") @PostMapping(value = "/private/studioMerchant/getLatestApply")
JsonResult<StudioMerchantApplyVO> getLatestApply(GetStudioLatestMerchantApplyRequest request); JsonResult<StudioMerchantApplyVO> getLatestApply(GetStudioLatestMerchantApplyRequest request);
@ApiOperation(value = "查询最近一条成功的申请记录", tags = {TAG})
@PostMapping(value = "/private/studioMerchant/getLatestSuccessApply")
JsonResult<StudioMerchantApplyVO> getLatestSuccessApply(GetStudioLatestMerchantApplyRequest request);
@ApiOperation(value = "分页查询场馆进件申请记录", tags = {TAG}) @ApiOperation(value = "分页查询场馆进件申请记录", tags = {TAG})
@PostMapping(value = "/private/studioMerchant/pageApply") @PostMapping(value = "/private/studioMerchant/pageApply")
JsonResult<PageVO<StudioMerchantApplyVO>> pageApply(PageStudioMerchantApplyRequest request); JsonResult<PageVO<StudioMerchantApplyVO>> pageApply(PageStudioMerchantApplyRequest request);
......
...@@ -70,6 +70,12 @@ public class StudioMerchantApiFallback implements FallbackFactory<StudioMerchant ...@@ -70,6 +70,12 @@ public class StudioMerchantApiFallback implements FallbackFactory<StudioMerchant
} }
@Override @Override
public JsonResult<StudioMerchantApplyVO> getLatestSuccessApply(
GetStudioLatestMerchantApplyRequest request) {
return JsonResult.rpcError();
}
@Override
public JsonResult<PageVO<StudioMerchantApplyVO>> pageApply(PageStudioMerchantApplyRequest request) { public JsonResult<PageVO<StudioMerchantApplyVO>> pageApply(PageStudioMerchantApplyRequest request) {
return JsonResult.rpcError(); return JsonResult.rpcError();
} }
......
...@@ -103,6 +103,14 @@ public class StudioMerchantController implements StudioMerchantApi { ...@@ -103,6 +103,14 @@ public class StudioMerchantController implements StudioMerchantApi {
return JsonResult.success(studioMerchantService.getLatestApply(request.getStudioId())); return JsonResult.success(studioMerchantService.getLatestApply(request.getStudioId()));
} }
@ApiOperation(value = "查询最近一条成功的申请记录", tags = {TAG})
@PostMapping(value = "/private/studioMerchant/getLatestSuccessApply")
@Override
public JsonResult<StudioMerchantApplyVO> getLatestSuccessApply(
@RequestBody @Valid GetStudioLatestMerchantApplyRequest request) {
return JsonResult.success(studioMerchantService.getLatestSuccessApply(request.getStudioId()));
}
@ApiOperation(value = "分页查询场馆进件申请记录", tags = {TAG}) @ApiOperation(value = "分页查询场馆进件申请记录", tags = {TAG})
@PostMapping(value = "/private/studioMerchant/pageApply") @PostMapping(value = "/private/studioMerchant/pageApply")
@Override @Override
......
...@@ -144,4 +144,14 @@ public class StudioMerchantApplyRpService extends ...@@ -144,4 +144,14 @@ public class StudioMerchantApplyRpService extends
.findFirst().orElse(null); .findFirst().orElse(null);
} }
public StudioMerchantApply getLatestSuccessApply(Long studioId) {
QueryWrapper<StudioMerchantApply> wrapper = new QueryWrapper<>();
wrapper.eq(StudioMerchantApply.STUDIO_ID, studioId);
wrapper.in(StudioMerchantApply.APPLY_TYPE,
Lists.newArrayList(ApplyTypeEnum.OPEN.getCode(), ApplyTypeEnum.RE_OPEN.getCode()));
wrapper.eq(StudioMerchantApply.OPEN_STATE, OpenStateEnums.SUCCESS.getCode());
wrapper.orderByDesc(StudioMerchantApply.ID);
return Optional.ofNullable(this.baseMapper.selectList(wrapper)).orElse(new ArrayList<>(1)).stream()
.findFirst().orElse(null);
}
} }
...@@ -136,4 +136,12 @@ public interface StudioMerchantService { ...@@ -136,4 +136,12 @@ public interface StudioMerchantService {
*/ */
Boolean checkUnbind(Long studioId, Long merchantId); Boolean checkUnbind(Long studioId, Long merchantId);
/**
* 获取最后一条成功的申请记录
*
* @param studioId 场馆ID
* @return 申请记录
*/
StudioMerchantApplyVO getLatestSuccessApply(Long studioId);
} }
...@@ -282,6 +282,16 @@ public class StudioMerchantServiceImpl implements StudioMerchantService { ...@@ -282,6 +282,16 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
.anyMatch(e -> !e.getPartyId().equals(studioId)); .anyMatch(e -> !e.getPartyId().equals(studioId));
} }
@Override
public StudioMerchantApplyVO getLatestSuccessApply(Long studioId) {
StudioMerchantApply apply = studioMerchantApplyRpService.getLatestSuccessApply(studioId);
if (null == apply) {
return null;
}
Map<Long, String> urlMap = this.getResouceseUrlMap(apply);
return MerchantConvert.convertApply(apply, urlMap);
}
private void doOpenMerchantSuccess(MerchantEvent event) { private void doOpenMerchantSuccess(MerchantEvent event) {
StudioMerchantApply apply = studioMerchantApplyRpService.getByIdForUpdate( StudioMerchantApply apply = studioMerchantApplyRpService.getByIdForUpdate(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment