feat:商户远程调用

This commit is contained in:
dzc committed 2025-01-02 12:11:29 +08:00
1 parent c086729afb
commit fbab10ba0e
4 files changed
+28 -5

No files matched your search

@@ -1,8 +1,19 @@
package com.bsd.pjcloud.wallet.api.dto;
import com.bsd.pjcloud.wallet.api.entity.MchManageEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class MchManageDto extends MchManageEntity {
private List<Long> deptIds;
}
@@ -18,6 +18,10 @@ public interface RemoteMchService {
@GetMapping("/get-by-id")
R<MchManageDto> getById(@RequestParam Long id);
@NoToken
@GetMapping("/get-by-ids")
R<List<MchManageDto>> getByIds(@RequestParam List<Long> ids);
@NoToken
@GetMapping("/get-by-dept-id")
R<MchManageDto> getByDeptId(@RequestParam Long deptId);
@@ -14,6 +14,7 @@ import com.bsd.pjcloud.wallet.api.constant.WalletTypeCodeEnum;
import com.bsd.pjcloud.wallet.api.dto.MchManageDto;
import com.bsd.pjcloud.wallet.api.entity.MchManageEntity;
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
import com.bsd.pjcloud.wallet.service.MchManageService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
@@ -35,8 +36,8 @@ import java.util.List;
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/mchManage")
@Tag(description = "mchManage", name = "商户管理管理")
@RequestMapping("/mch-manage")
@Tag(description = "mch-manage", name = "商户管理管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class MchManageController {
@@ -52,6 +53,14 @@ public class MchManageController {
return R.ok(BeanUtils.toBean(mchManage, MchManageDto.class));
}
@Inner
@GetMapping("/get-by-ids")
public R<List<MchManageDto>> getByIds(@RequestParam List<Long> ids) {
Page<MchManageVo> page = mchManageService.pageJoin(new Page<>(), MchManageDto.builder().deptIds(ids).build());
if (ObjectUtil.isAllNotEmpty(page, page.getRecords())) return R.failed("商户不存在");
return R.ok(BeanUtils.toBean(page.getRecords(), MchManageDto.class));
}
@Inner
@GetMapping("/get-by-dept-id")
public R<MchManageDto> getByDeptId(@RequestParam Long deptId) {
@@ -93,9 +102,9 @@ public class MchManageController {
* @return
*/
@Operation(summary = "分页复杂查询", description = "分页查询")
@GetMapping("/page")
@GetMapping("/page-join")
@PreAuthorize("@pms.hasPermission('wallet_mchManage_view')")
public R getMchManagePage(@ParameterObject Page page, @ParameterObject MchManageDto dto) {
public R getMchManagePageJoin(@ParameterObject Page page, @ParameterObject MchManageDto dto) {
return R.ok(mchManageService.pageJoin(page, dto));
}
-1
View File
@@ -125,7 +125,6 @@
<module>pjcloud-wallet</module>
<module>pjcloud-supermarket</module>
<module>pjcloud-hardware</module>
<module>pjcloud-merchant</module>
</modules>
<dependencyManagement>