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; +} diff --git a/jsowell-ui/.env.development b/jsowell-ui/.env.development index 18654a1eb..f68a388a6 100644 --- a/jsowell-ui/.env.development +++ b/jsowell-ui/.env.development @@ -1,11 +1,11 @@ # 页面标题 VUE_APP_TITLE = 万车充运营管理平台 -# 开发环境配置 +# pre环境配置 ENV = 'development' -# 万车充运营管理平台/开发环境 -VUE_APP_BASE_API = '/dev-api' +# 万车充运营管理平台/pre环境 +VUE_APP_BASE_API = 'https://apitest.jsowellcloud.com' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/jsowell-ui/.env.production b/jsowell-ui/.env.production index 6ee239ce9..8cac4b189 100644 --- a/jsowell-ui/.env.production +++ b/jsowell-ui/.env.production @@ -1,8 +1,8 @@ # 页面标题 VUE_APP_TITLE = 万车充运营管理平台 -# 生产环境配置 +# 正式环境配置 ENV = 'production' -# 万车充运营管理平台/生产环境 -VUE_APP_BASE_API = '/prod-api' +# 万车充运营管理平台/正式环境 +VUE_APP_BASE_API = 'https://api.jsowellcloud.com' diff --git a/jsowell-ui/.env.staging b/jsowell-ui/.env.staging index 189957570..f7aa19364 100644 --- a/jsowell-ui/.env.staging +++ b/jsowell-ui/.env.staging @@ -5,7 +5,7 @@ VUE_APP_TITLE = 万车充运营管理平台 ENV = 'staging' # 万车充运营管理平台/测试环境 -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = 'http://192.168.2.21:8080' # 开发环境配置 NODE_ENV = production diff --git a/jsowell-ui/package.json b/jsowell-ui/package.json index 8480e66e4..aa7a51eb2 100644 --- a/jsowell-ui/package.json +++ b/jsowell-ui/package.json @@ -3,7 +3,9 @@ "version": "1.0.0", "description": "万车充管理系统", "scripts": { - "dev": "vue-cli-service serve", + "dev": "vue-cli-service serve --mode production", + "pre": "vue-cli-service serve --mode development", + "test": "vue-cli-service serve --mode staging", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", diff --git a/jsowell-ui/vue.config.js b/jsowell-ui/vue.config.js index f0456c6dc..6f18315a5 100644 --- a/jsowell-ui/vue.config.js +++ b/jsowell-ui/vue.config.js @@ -35,12 +35,12 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - // target: `http://localhost:8080`, + target: `http://localhost:8080`, // 更改代理为本地地址 // target: `http://106.14.94.149:8080`, // target: `http://192.168.2.21:8080`, // target: `https://api.jsowellcloud.com`, - target: `https://apitest.jsowellcloud.com`, + // target: `https://apitest.jsowellcloud.com`, changeOrigin: true, pathRewrite: { ["^" + process.env.VUE_APP_BASE_API]: "",