|
@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
|
|
|
import com.ym.mec.biz.dal.entity.SysPaymentConfig;
|
|
|
import com.ym.mec.biz.service.SysPaymentConfigService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.page.QueryInfo;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -22,18 +23,25 @@ public class SysPaymentConfigController extends BaseController {
|
|
|
@ApiOperation(value = "新增支付配置")
|
|
|
@PostMapping("/add")
|
|
|
@PreAuthorize("@pcs.hasPermissions('paymentConfig/add')")
|
|
|
- public Object add(SysPaymentConfig sysPaymentConfig){
|
|
|
+ public HttpResponseResult add(SysPaymentConfig sysPaymentConfig) {
|
|
|
+ if (sysPaymentConfig.getOrganId() == null) {
|
|
|
+ return failed("请选择分部");
|
|
|
+ }
|
|
|
+ SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(sysPaymentConfig.getOrganId());
|
|
|
+ if (paymentConfig != null) {
|
|
|
+ return failed("此分部配置已经存在");
|
|
|
+ }
|
|
|
return succeed(sysPaymentConfigService.insert(sysPaymentConfig));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除支付配置")
|
|
|
@PostMapping("/del/{id}")
|
|
|
@PreAuthorize("@pcs.hasPermissions('paymentConfig/del')")
|
|
|
- public Object del(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id){
|
|
|
- SysPaymentConfig sysPaymentConfig = sysPaymentConfigService.get(id);
|
|
|
- if(sysPaymentConfig == null){
|
|
|
- return failed("参数错误");
|
|
|
- }
|
|
|
+ public Object del(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id) {
|
|
|
+ SysPaymentConfig sysPaymentConfig = sysPaymentConfigService.get(id);
|
|
|
+ if (sysPaymentConfig == null) {
|
|
|
+ return failed("参数错误");
|
|
|
+ }
|
|
|
sysPaymentConfigService.delete(id);
|
|
|
return succeed();
|
|
|
}
|
|
@@ -41,7 +49,7 @@ public class SysPaymentConfigController extends BaseController {
|
|
|
@ApiOperation(value = "修改支付配置")
|
|
|
@PostMapping("/update")
|
|
|
@PreAuthorize("@pcs.hasPermissions('paymentConfig/update')")
|
|
|
- public Object update(SysPaymentConfig sysPaymentConfig){
|
|
|
+ public Object update(SysPaymentConfig sysPaymentConfig) {
|
|
|
sysPaymentConfig.setUpdateTime(new Date());
|
|
|
sysPaymentConfigService.update(sysPaymentConfig);
|
|
|
return succeed();
|
|
@@ -50,14 +58,14 @@ public class SysPaymentConfigController extends BaseController {
|
|
|
@ApiOperation(value = "根据支付配置编号查询支付配置")
|
|
|
@GetMapping("/get/{id}")
|
|
|
@PreAuthorize("@pcs.hasPermissions('paymentConfig/get')")
|
|
|
- public Object get(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id){
|
|
|
+ public Object get(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id) {
|
|
|
return succeed(sysPaymentConfigService.get(id));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询支付配置列表")
|
|
|
@GetMapping("/queryPage")
|
|
|
@PreAuthorize("@pcs.hasPermissions('paymentConfig/queryPage')")
|
|
|
- public Object queryPage(QueryInfo queryInfo){
|
|
|
+ public Object queryPage(QueryInfo queryInfo) {
|
|
|
return succeed(sysPaymentConfigService.queryPage(queryInfo));
|
|
|
}
|
|
|
}
|