mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update 修改结算
This commit is contained in:
@@ -38,6 +38,7 @@ public class JumpController extends BaseController {
|
||||
@GetMapping("/pile/pileDetail/{pileSn}")
|
||||
public RestApiResponse<?> getPileDetail(HttpServletRequest request, @PathVariable("pileSn") String pileSn) {
|
||||
logger.info("app-xcx-h5查询充电桩详情 param:{}", pileSn);
|
||||
logger.info("User-Agent:{}", request.getHeader("user-agent"));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
PileConnectorVO vo = pileService.getPileDetailByPileSn(pileSn);
|
||||
@@ -60,6 +61,7 @@ public class JumpController extends BaseController {
|
||||
@GetMapping("/pile/connectorDetail/{pileConnectorCode}")
|
||||
public RestApiResponse<?> getConnectorDetail(HttpServletRequest request, @PathVariable("pileConnectorCode") String pileConnectorCode) {
|
||||
logger.info("app-xcx-h5查询充电枪口详情 param:{}", pileConnectorCode);
|
||||
logger.info("User-Agent:{}", request.getHeader("user-agent"));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
PileConnectorVO vo = pileService.getConnectorDetail(pileConnectorCode);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.jsowell.web.controller.pile;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.dto.AdapayMemberInfoDTO;
|
||||
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
|
||||
import com.jsowell.adapay.service.AdapayMemberService;
|
||||
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
@@ -77,4 +78,22 @@ public class AdapayMemberController extends BaseController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改结算
|
||||
* http://localhost:8080/adapay/member/updateSettleAccountConfig
|
||||
* 修改商户或用户结算账户的起始金额、结算留存金额、结算信息摘要等 配置参数
|
||||
*/
|
||||
@PostMapping("/updateSettleAccountConfig")
|
||||
public AjaxResult updateSettleAccountConfig(@RequestBody UpdateAccountConfigDTO dto) {
|
||||
AjaxResult result;
|
||||
try {
|
||||
adapayMemberService.updateSettleAccountConfig(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (BaseAdaPayException e) {
|
||||
logger.error("查询汇付账户余额error", e);
|
||||
result = AjaxResult.error();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jsowell.adapay.dto;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class UpdateAccountConfigDTO {
|
||||
private String merchantId;
|
||||
|
||||
// 结算起始金额 ( 0.00格式,整数部分最长13位,小数部分最长2位) min_amt, remained_amt,channel_remark至少有一个不为空
|
||||
private String minAmt;
|
||||
|
||||
// 结算留存金额 ( 0.00格式,整数部分最长13位,小数部分最长2位)
|
||||
private String remainedAmt;
|
||||
|
||||
// 结算信息摘要,银行出款时摘要信息
|
||||
private String channelRemark;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.huifu.adapay.model.Member;
|
||||
import com.huifu.adapay.model.SettleAccount;
|
||||
import com.jsowell.adapay.dto.AdapayMemberInfoDTO;
|
||||
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
|
||||
import com.jsowell.adapay.response.QueryMemberResponse;
|
||||
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
|
||||
import com.jsowell.adapay.vo.AdapayMemberInfoVO;
|
||||
@@ -38,6 +39,7 @@ public class AdapayMemberService {
|
||||
|
||||
/**
|
||||
* 创建汇付会员
|
||||
*
|
||||
* @param dto
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -121,6 +123,7 @@ public class AdapayMemberService {
|
||||
|
||||
/**
|
||||
* 查询汇付会员信息
|
||||
*
|
||||
* @param merchantId
|
||||
* @return
|
||||
*/
|
||||
@@ -244,4 +247,26 @@ public class AdapayMemberService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
public void updateSettleAccountConfig(UpdateAccountConfigDTO dto) throws BaseAdaPayException {
|
||||
// 通过merchantId 查询出汇付会员id 和 结算账户id,用来查询余额
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
|
||||
if (adapayMemberAccount == null) {
|
||||
return;
|
||||
}
|
||||
// 修改账户配置
|
||||
Map<String, Object> params = Maps.newHashMap();
|
||||
params.put("app_id", ADAPAY_APP_ID);
|
||||
params.put("member_id", adapayMemberAccount.getAdapayMemberId());
|
||||
params.put("settle_account_id", adapayMemberAccount.getSettleAccountId());
|
||||
if (StringUtils.isNotBlank(dto.getMinAmt())) {
|
||||
params.put("min_amt", dto.getMinAmt());
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getRemainedAmt())) {
|
||||
params.put("remained_amt", dto.getRemainedAmt());
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getChannelRemark())) {
|
||||
params.put("channel_remark", dto.getChannelRemark());
|
||||
}
|
||||
Map<String, Object> settleCount = SettleAccount.update(params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user