|
@@ -2,11 +2,13 @@ package com.ym.mec.web.controller;
|
|
|
|
|
|
|
|
import com.ym.mec.biz.dal.entity.SysPaymentConfig;
|
|
import com.ym.mec.biz.dal.entity.SysPaymentConfig;
|
|
|
import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
|
|
import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
|
|
|
|
|
+import com.ym.mec.biz.dal.page.SysPaymentConfigQueryInfo;
|
|
|
import com.ym.mec.biz.service.SysPaymentConfigService;
|
|
import com.ym.mec.biz.service.SysPaymentConfigService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.page.QueryInfo;
|
|
import com.ym.mec.common.page.QueryInfo;
|
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -69,7 +71,7 @@ public class SysPaymentConfigController extends BaseController {
|
|
|
@ApiOperation(value = "分页查询支付配置列表")
|
|
@ApiOperation(value = "分页查询支付配置列表")
|
|
|
@GetMapping("/queryPage")
|
|
@GetMapping("/queryPage")
|
|
|
@PreAuthorize("@pcs.hasPermissions('paymentConfig/queryPage')")
|
|
@PreAuthorize("@pcs.hasPermissions('paymentConfig/queryPage')")
|
|
|
- public Object queryPage(QueryInfo queryInfo) {
|
|
|
|
|
|
|
+ public Object queryPage(SysPaymentConfigQueryInfo queryInfo) {
|
|
|
return succeed(sysPaymentConfigService.queryPage(queryInfo));
|
|
return succeed(sysPaymentConfigService.queryPage(queryInfo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -80,4 +82,53 @@ public class SysPaymentConfigController extends BaseController {
|
|
|
return succeed(sysPaymentConfigService.getPaymentConfigs(payType));
|
|
return succeed(sysPaymentConfigService.getPaymentConfigs(payType));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "新增按费用类型配置")
|
|
|
|
|
+ @PostMapping("/addTypeRoute")
|
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('paymentConfig/addTypeRoute')")
|
|
|
|
|
+ public HttpResponseResult<SysPaymentConfig> addTypeRoute(SysPaymentConfig config) {
|
|
|
|
|
+ if (StringUtils.isBlank(config.getTypeRouteScale())) {
|
|
|
|
|
+ return failed("分润配置不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ SysPaymentConfig paymentConfig = sysPaymentConfigService.get(config.getId());
|
|
|
|
|
+ if (paymentConfig != null && StringUtils.isNotBlank(paymentConfig.getTypeRouteScale())) {
|
|
|
|
|
+ return failed("此分部配置存在,请核查");
|
|
|
|
|
+ }
|
|
|
|
|
+ Date nowDate = new Date();
|
|
|
|
|
+ paymentConfig.setTypeRouteScale(config.getTypeRouteScale());
|
|
|
|
|
+ paymentConfig.setUpdateTime(nowDate);
|
|
|
|
|
+ sysPaymentConfigService.update(paymentConfig);
|
|
|
|
|
+ return succeed(paymentConfig);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "更新按费用类型配置")
|
|
|
|
|
+ @PostMapping("/updateTypeRoute")
|
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('paymentConfig/updateTypeRoute')")
|
|
|
|
|
+ public HttpResponseResult<SysPaymentConfig> updateTypeRoute(SysPaymentConfig config) {
|
|
|
|
|
+ if (StringUtils.isBlank(config.getTypeRouteScale())) {
|
|
|
|
|
+ return failed("分润配置不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ SysPaymentConfig paymentConfig = sysPaymentConfigService.get(config.getId());
|
|
|
|
|
+ Date nowDate = new Date();
|
|
|
|
|
+ paymentConfig.setTypeRouteScale(config.getTypeRouteScale());
|
|
|
|
|
+ paymentConfig.setUpdateTime(nowDate);
|
|
|
|
|
+ sysPaymentConfigService.update(paymentConfig);
|
|
|
|
|
+ return succeed(paymentConfig);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "删除按费用类型配置")
|
|
|
|
|
+ @PostMapping("/delTypeRoute")
|
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('paymentConfig/delTypeRoute')")
|
|
|
|
|
+ public HttpResponseResult<SysPaymentConfig> delTypeRoute(Integer id) {
|
|
|
|
|
+ SysPaymentConfig paymentConfig = sysPaymentConfigService.get(id);
|
|
|
|
|
+ if (paymentConfig != null) {
|
|
|
|
|
+ return failed("此分部配置不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ Date nowDate = new Date();
|
|
|
|
|
+ paymentConfig.setTypeRouteScale("");
|
|
|
|
|
+ paymentConfig.setUpdateTime(nowDate);
|
|
|
|
|
+ sysPaymentConfigService.update(paymentConfig);
|
|
|
|
|
+ return succeed(paymentConfig);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|