mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-27 06:25:13 +08:00
update 重构汇付会员
This commit is contained in:
@@ -18,6 +18,7 @@ import com.jsowell.pile.service.ClearingWithdrawInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -30,14 +31,55 @@ public class AdapayMemberController extends BaseController {
|
||||
@Autowired
|
||||
private ClearingWithdrawInfoService clearingWithdrawInfoService;
|
||||
|
||||
/**
|
||||
* 创建个人用户
|
||||
*/
|
||||
@PostMapping("/createAdapayMember")
|
||||
public AjaxResult createAdapayMember(@RequestBody CreatePersonalMemberDTO dto) {
|
||||
AjaxResult result;
|
||||
try {
|
||||
if (StringUtils.isBlank(dto.getMerchantId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
adapayService.createAdapayMember(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("创建个人汇付用户接口warn", e);
|
||||
result = AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("创建个人汇付用户接口error", e);
|
||||
result = AjaxResult.error("创建个人汇付用户接口异常:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建企业用户
|
||||
*/
|
||||
@PostMapping("/createCorpMember")
|
||||
public AjaxResult createCorpMember(@RequestBody CreateCorpMemberDTO dto) {
|
||||
AjaxResult result;
|
||||
try {
|
||||
if (StringUtils.isBlank(dto.getMerchantId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
adapayService.createCorpMember(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("创建企业汇付用户接口warn", e);
|
||||
result = AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("创建企业汇付用户接口error", e);
|
||||
result = AjaxResult.error("创建企业汇付用户接口异常:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建结算账户
|
||||
* http://localhost:8080/adapay/member/createSettleAccount
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/createSettleAccount")
|
||||
public AjaxResult createSettleAccount(@RequestBody SettleAccountDTO dto) {
|
||||
public AjaxResult createSettleAccount(@RequestBody CreateSettleAccountDTO dto) {
|
||||
logger.info("创建结算账户接口 param:{}", JSON.toJSONString(dto));
|
||||
AjaxResult result;
|
||||
try {
|
||||
@@ -59,7 +101,6 @@ public class AdapayMemberController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询汇付会员接口
|
||||
* http://localhost:8080/adapay/member/selectAdapayMember
|
||||
*/
|
||||
@PostMapping("/selectAdapayMember")
|
||||
public AjaxResult selectAdapayMember(@RequestBody AdapayMemberInfoDTO dto) {
|
||||
@@ -68,8 +109,7 @@ public class AdapayMemberController extends BaseController {
|
||||
if (StringUtils.isBlank(dto.getMerchantId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
Map<String, Object> map = adapayService.selectAdapayMember(dto.getMerchantId());
|
||||
result = AjaxResult.success(map);
|
||||
result = AjaxResult.success(adapayService.selectAdapayMember(dto.getMerchantId()));
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("查询汇付会员接口异常warn", e);
|
||||
result = AjaxResult.error(e.getMessage());
|
||||
@@ -81,24 +121,67 @@ public class AdapayMemberController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新结算账户接口
|
||||
* http://localhost:8080/adapay/member/updateAdapayMember
|
||||
* 查询结算账户接口
|
||||
*/
|
||||
@PostMapping("/updateAdapayMember")
|
||||
public AjaxResult updateAdapayMember(@RequestBody SettleAccountDTO dto) {
|
||||
@PostMapping("/selectSettleAccount")
|
||||
public AjaxResult selectSettleAccount(@RequestBody AdapayMemberInfoDTO dto) {
|
||||
AjaxResult result;
|
||||
try {
|
||||
if (StringUtils.isBlank(dto.getMerchantId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
Map<String, Object> map = adapayService.updateAdapayMember(dto);
|
||||
result = AjaxResult.success(map);
|
||||
List<?> list = adapayService.selectSettleAccount(dto.getMerchantId());
|
||||
result = AjaxResult.success(list);
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("更新结算账户接口warn", e);
|
||||
logger.warn("查询结算账户接口warn", e);
|
||||
result = AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("更新结算账户接口error", e);
|
||||
result = AjaxResult.error("查询汇付会员接口异常");
|
||||
logger.error("查询结算账户接口error", e);
|
||||
result = AjaxResult.error("查询结算账户接口异常");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新汇付会员接口
|
||||
*/
|
||||
@PostMapping("/updateAdapayMember")
|
||||
public AjaxResult updateAdapayMember(@RequestBody Map<String, Object> dto) {
|
||||
AjaxResult result;
|
||||
try {
|
||||
if (StringUtils.isBlank((String) dto.get("merchantId"))) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
adapayService.updateAdapayMember(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("更新汇付会员接口warn", e);
|
||||
result = AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("更新汇付会员接口error", e);
|
||||
result = AjaxResult.error("更新汇付会员接口异常");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除汇付会员绑定关系
|
||||
*/
|
||||
@PostMapping("/deleteAdapayMember")
|
||||
public AjaxResult deleteAdapayMember(@RequestBody DeleteAdapayMemberDTO dto) {
|
||||
AjaxResult result;
|
||||
try {
|
||||
if (StringUtils.isBlank(dto.getMerchantId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
adapayService.deleteAdapayMember(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("删除汇付会员绑定接口warn", e);
|
||||
result = AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("删除汇付会员绑定接口error", e);
|
||||
result = AjaxResult.error("删除汇付会员绑定接口异常");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user