From 76a32f79ee724271cd410dbb914eb7551f7350f7 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 6 Mar 2025 14:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=90=A5=E5=95=86=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=8F=90=E7=8E=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/PileMerchantInfoController.java | 25 ++++++++++--- .../pile/dto/MerchantWithdrawalTypeDTO.java | 6 ++++ .../pile/service/PileMerchantInfoService.java | 5 +++ .../impl/PileMerchantInfoServiceImpl.java | 35 ++++++++++++++++--- .../jsowell/pile/vo/base/MerchantInfoVO.java | 12 +++++++ .../pile/vo/web/MerchantWithdrawalTypeVO.java | 32 +++++++++++++++++ 6 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/dto/MerchantWithdrawalTypeDTO.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/vo/web/MerchantWithdrawalTypeVO.java diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java index 43f66dd48..00e832705 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java @@ -6,22 +6,18 @@ import com.jsowell.common.core.domain.AjaxResult; import com.jsowell.common.core.page.TableDataInfo; import com.jsowell.common.enums.BusinessType; import com.jsowell.common.exception.BusinessException; -import com.jsowell.common.response.RestApiResponse; import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.poi.ExcelUtil; import com.jsowell.pile.domain.PileMerchantInfo; import com.jsowell.pile.dto.CreateMerchantDTO; import com.jsowell.pile.dto.QueryMerchantInfoDTO; import com.jsowell.pile.service.PileMerchantInfoService; -import com.jsowell.pile.util.UserUtils; -import com.jsowell.pile.vo.base.MerchantInfoVO; -import org.apache.commons.collections4.CollectionUtils; +import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; import java.util.List; /** @@ -140,4 +136,23 @@ public class PileMerchantInfoController extends BaseController { PageUtils.startPage(pageNum, pageSize); return getDataTable(pileMerchantInfoService.queryMerchantInfoListByAuth(dto)); } + + /** + * 查询运营商配置的提现方式 + */ + @PreAuthorize("@ss.hasPermi('pile:merchant:query')") + @PostMapping("/queryWithdrawalType") + public AjaxResult queryWithdrawalType(@RequestBody QueryMerchantInfoDTO dto) { + return AjaxResult.success(pileMerchantInfoService.queryWithdrawalType(dto)); + } + + /** + * 修改提现方式 + */ + @PreAuthorize("@ss.hasPermi('pile:merchant:edit')") + @Log(title = "修改提现方式", businessType = BusinessType.UPDATE) + @PutMapping("/updateWithdrawalType") + public AjaxResult updateWithdrawalType(@RequestBody MerchantWithdrawalTypeVO dto) { + return toAjax(pileMerchantInfoService.updateWithdrawalType(dto)); + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/MerchantWithdrawalTypeDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/MerchantWithdrawalTypeDTO.java new file mode 100644 index 000000000..b76264fdc --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/MerchantWithdrawalTypeDTO.java @@ -0,0 +1,6 @@ +package com.jsowell.pile.dto; + +import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO; + +public class MerchantWithdrawalTypeDTO extends MerchantWithdrawalTypeVO { +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java index 58285062a..6629150f8 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java @@ -5,6 +5,7 @@ import com.jsowell.pile.dto.CreateMerchantDTO; import com.jsowell.pile.dto.QueryMerchantInfoDTO; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.web.MerchantSettleInfoVO; +import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO; import com.jsowell.pile.vo.web.PileMerchantInfoVO; import java.util.List; @@ -187,4 +188,8 @@ public interface PileMerchantInfoService { * @return */ PileMerchantInfoVO queryMerchantInfoByStationId(String stationId); + + MerchantWithdrawalTypeVO queryWithdrawalType(QueryMerchantInfoDTO dto); + + int updateWithdrawalType(MerchantWithdrawalTypeVO dto); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java index 352497544..2fe11aa91 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java @@ -8,10 +8,7 @@ import com.jsowell.common.core.domain.vo.AuthorizedDeptVO; import com.jsowell.common.enums.adapay.AdapayPayChannelEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.exception.BusinessException; -import com.jsowell.common.util.DateUtils; -import com.jsowell.common.util.DictUtils; -import com.jsowell.common.util.PageUtils; -import com.jsowell.common.util.StringUtils; +import com.jsowell.common.util.*; import com.jsowell.common.util.spring.SpringUtils; import com.jsowell.pile.domain.PileMerchantInfo; import com.jsowell.pile.dto.CreateMerchantDTO; @@ -21,6 +18,7 @@ import com.jsowell.pile.service.PileMerchantInfoService; import com.jsowell.pile.util.UserUtils; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.web.MerchantSettleInfoVO; +import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO; import com.jsowell.pile.vo.web.PileMerchantInfoVO; import com.jsowell.system.service.SysDeptService; import com.jsowell.system.service.SysUserService; @@ -643,4 +641,33 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService { return pileMerchantInfoMapper.queryMerchantInfoByStationId(stationId); } + @Override + public MerchantWithdrawalTypeVO queryWithdrawalType(QueryMerchantInfoDTO dto) { + PileMerchantInfo pileMerchantInfo = pileMerchantInfoMapper.selectPileMerchantInfoById(Long.parseLong(dto.getMerchantId())); + if (pileMerchantInfo != null) { + MerchantWithdrawalTypeVO merchantWithdrawalTypeVO = new MerchantWithdrawalTypeVO(); + merchantWithdrawalTypeVO.setMerchantId(pileMerchantInfo.getId() + ""); + merchantWithdrawalTypeVO.setWithdrawalType(pileMerchantInfo.getDelayMode()); + merchantWithdrawalTypeVO.setReservedAmount(pileMerchantInfo.getReservedAmount()); + return merchantWithdrawalTypeVO; + } + return null; + } + + @Override + public int updateWithdrawalType(MerchantWithdrawalTypeVO dto) { + if (dto == null || StringUtils.isBlank(dto.getMerchantId()) || StringUtils.isBlank(dto.getWithdrawalType())) { + return 0; + } + PileMerchantInfo merchantInfo = new PileMerchantInfo(); + merchantInfo.setId(Long.parseLong(dto.getMerchantId())); + merchantInfo.setWithdrawalType(dto.getWithdrawalType()); + if (dto.getReservedAmount() != null) { + merchantInfo.setReservedAmount(dto.getReservedAmount()); + } + merchantInfo.setUpdateBy(SecurityUtils.getUsername()); + merchantInfo.setUpdateTime(DateUtils.getNowDate()); + return pileMerchantInfoMapper.updatePileMerchantInfo(merchantInfo); + } + } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/MerchantInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/MerchantInfoVO.java index cff51b5df..26463c962 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/MerchantInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/MerchantInfoVO.java @@ -5,6 +5,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.math.BigDecimal; + @Data @NoArgsConstructor @AllArgsConstructor @@ -50,4 +52,14 @@ public class MerchantInfoVO { */ private String adapayMemberId; + /** + * 提现类型(1-手动提现, 2-自动提现) + */ + private String withdrawalType; + + /** + * 预留金额 + */ + private BigDecimal reservedAmount; + } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/MerchantWithdrawalTypeVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/MerchantWithdrawalTypeVO.java new file mode 100644 index 000000000..5f284aaa1 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/MerchantWithdrawalTypeVO.java @@ -0,0 +1,32 @@ +package com.jsowell.pile.vo.web; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * 运营商提现类型VO + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class MerchantWithdrawalTypeVO { + /** + * 运营商ID + */ + private String merchantId; + + /** + * 提现类型(1-手动提现, 2-自动提现) + */ + private String withdrawalType; + + /** + * 预留金额 + */ + private BigDecimal reservedAmount; +}