Commit fc0b35b4 authored by suntao's avatar suntao

format

parent dba43571
package cn.quantgroup.cashloanflowboss.api.order.controller; package cn.quantgroup.cashloanflowboss.api.order.controller;
import cn.quantgroup.cashloanflowboss.api.order.model.ApproveVo; import cn.quantgroup.cashloanflowboss.api.order.model.ApproveVo;
import cn.quantgroup.cashloanflowboss.api.order.model.LendingFormModel; import cn.quantgroup.cashloanflowboss.api.order.model.LendingFormModel;
import cn.quantgroup.cashloanflowboss.api.order.service.OrderService; import cn.quantgroup.cashloanflowboss.api.order.service.OrderService;
...@@ -30,10 +31,10 @@ public class OrderController { ...@@ -30,10 +31,10 @@ public class OrderController {
/** /**
*
* 订单查询列表接口 * 订单查询列表接口
* * <p>
* 渠道用户只能查自己渠道订单 如果是别的渠道订单 不能查询(如果channelId 赋值 channelOrderNumber 是别的渠道订单 应该查询不到数据,所以不需要CheckChannelRole) * 渠道用户只能查自己渠道订单 如果是别的渠道订单 不能查询(如果channelId 赋值 channelOrderNumber 是别的渠道订单 应该查询不到数据,所以不需要CheckChannelRole)
*
* @param channelId * @param channelId
* @param channelOrderNumber * @param channelOrderNumber
* @param pageNumber * @param pageNumber
...@@ -53,8 +54,9 @@ public class OrderController { ...@@ -53,8 +54,9 @@ public class OrderController {
/** /**
* 审批接口 * 审批接口
* * <p>
* 渠道只能审批自己渠道的订单 * 渠道只能审批自己渠道的订单
*
* @param approveVo * @param approveVo
* @return * @return
*/ */
...@@ -62,13 +64,11 @@ public class OrderController { ...@@ -62,13 +64,11 @@ public class OrderController {
@CheckChannelRole(channelOrderNumberSPEL = "#this[0].channelOrderNumber") @CheckChannelRole(channelOrderNumberSPEL = "#this[0].channelOrderNumber")
@PostMapping("/approve") @PostMapping("/approve")
public Result approveOpt(@RequestBody @Valid ApproveVo approveVo) { public Result approveOpt(@RequestBody @Valid ApproveVo approveVo) {
if (Application.isDebug()) { if (Application.isDebug()) {
Tuple<Boolean, String> approveOptBooleanAndFundSettingBooleanTuple = orderService.approveOpt(approveVo); final Tuple<Boolean, String> approveOptTuple = orderService.approveOpt(approveVo);
Boolean approveResult = approveOptBooleanAndFundSettingBooleanTuple.getKey(); return Result.buildSuccess(approveOptTuple.getKey(), approveOptTuple.getValue());
return Result.buildSuccess(approveResult, approveOptBooleanAndFundSettingBooleanTuple.getValue());
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false, "无此操作");
} }
} }
...@@ -82,10 +82,10 @@ public class OrderController { ...@@ -82,10 +82,10 @@ public class OrderController {
@PostMapping("/lending") @PostMapping("/lending")
public Result<Boolean> lending(@RequestBody @Valid LendingFormModel lendingFormModel) { public Result<Boolean> lending(@RequestBody @Valid LendingFormModel lendingFormModel) {
if (Application.isDebug()) { if (Application.isDebug()) {
Tuple<Boolean, String> lending = this.orderService.lending(lendingFormModel); final Tuple<Boolean, String> lending = this.orderService.lending(lendingFormModel);
return Result.buildSuccess(lending.getKey(), lending.getValue()); return Result.buildSuccess(lending.getKey(), lending.getValue());
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false, "无此操作");
} }
} }
...@@ -99,10 +99,10 @@ public class OrderController { ...@@ -99,10 +99,10 @@ public class OrderController {
@GetMapping("/secondAudit") @GetMapping("/secondAudit")
public Result<Boolean> secondAudit(String channelOrderNumber) { public Result<Boolean> secondAudit(String channelOrderNumber) {
if (Application.isDebug()) { if (Application.isDebug()) {
Tuple<Boolean, String> booleanStringTuple = this.orderService.secondAudit(channelOrderNumber); final Tuple<Boolean, String> booleanStringTuple = this.orderService.secondAudit(channelOrderNumber);
return Result.buildSuccess(booleanStringTuple.getKey(), booleanStringTuple.getValue()); return Result.buildSuccess(booleanStringTuple.getKey(), booleanStringTuple.getValue());
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false, "无此操作");
} }
} }
...@@ -119,13 +119,11 @@ public class OrderController { ...@@ -119,13 +119,11 @@ public class OrderController {
this.orderService.loadSecondAuditJob(); this.orderService.loadSecondAuditJob();
return Result.buildSuccess(true, "success"); return Result.buildSuccess(true, "success");
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false, "无此操作");
} }
} }
/** /**
* 贷前关单 * 贷前关单
* *
...@@ -136,10 +134,10 @@ public class OrderController { ...@@ -136,10 +134,10 @@ public class OrderController {
@PostMapping("/cancel/loan") @PostMapping("/cancel/loan")
public Result<Boolean> cancelPreLoan(@RequestParam @Valid String channelOrderNumber) { public Result<Boolean> cancelPreLoan(@RequestParam @Valid String channelOrderNumber) {
if (Application.isDebug()) { if (Application.isDebug()) {
Tuple<Boolean, String> preLoan = this.orderService.cancelPreLoan(channelOrderNumber); final Tuple<Boolean, String> preLoan = this.orderService.cancelPreLoan(channelOrderNumber);
return Result.buildSuccess(preLoan.getKey(),preLoan.getValue()); return Result.buildSuccess(preLoan.getKey(), preLoan.getValue());
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false, "无此操作");
} }
} }
...@@ -153,10 +151,10 @@ public class OrderController { ...@@ -153,10 +151,10 @@ public class OrderController {
@PostMapping("/cancel/after/loan") @PostMapping("/cancel/after/loan")
public Result<Boolean> cancelAfterLoan(@RequestParam @Valid String channelOrderNumber) { public Result<Boolean> cancelAfterLoan(@RequestParam @Valid String channelOrderNumber) {
if (Application.isDebug()) { if (Application.isDebug()) {
Tuple<Boolean, String> afterLoan = this.orderService.cancelAfterLoan(channelOrderNumber); final Tuple<Boolean, String> afterLoan = this.orderService.cancelAfterLoan(channelOrderNumber);
return Result.buildSuccess(afterLoan.getKey(),afterLoan.getValue()); return Result.buildSuccess(afterLoan.getKey(), afterLoan.getValue());
} else { } else {
return Result.buildSuccess(false,"无此操作"); return Result.buildSuccess(false, "无此操作");
} }
} }
...@@ -211,11 +209,9 @@ public class OrderController { ...@@ -211,11 +209,9 @@ public class OrderController {
@CheckChannelRole(channelOrderNumberSPEL = "#this[0]") @CheckChannelRole(channelOrderNumberSPEL = "#this[0]")
@GetMapping("/settle") @GetMapping("/settle")
public Result settle(String channelOrderNumber) { public Result settle(String channelOrderNumber) {
return Result.buildSuccess(orderService.settle(channelOrderNumber)); final Tuple<Boolean, String> settle = orderService.settle(channelOrderNumber);
return Result.buildSuccess(settle.getKey(), settle.getValue());
} }
} }
...@@ -12,6 +12,7 @@ import cn.quantgroup.cashloanflowboss.component.validator.constraints.NotEmpty; ...@@ -12,6 +12,7 @@ import cn.quantgroup.cashloanflowboss.component.validator.constraints.NotEmpty;
import cn.quantgroup.cashloanflowboss.core.base.Result; import cn.quantgroup.cashloanflowboss.core.base.Result;
import cn.quantgroup.cashloanflowboss.core.base.Tuple; import cn.quantgroup.cashloanflowboss.core.base.Tuple;
import cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService; import cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService;
import javax.validation.Valid; import javax.validation.Valid;
import cn.quantgroup.cashloanflowboss.spi.xyqb.service.XYQBCenterService; import cn.quantgroup.cashloanflowboss.spi.xyqb.service.XYQBCenterService;
...@@ -81,6 +82,7 @@ public class UserController { ...@@ -81,6 +82,7 @@ public class UserController {
* @return * @return
*/ */
@PutMapping("/enable") @PutMapping("/enable")
@Security(authorityId = "User.enable")
public Boolean enableUser(@RequestParam @Valid @NotEmpty(message = "无效的用户ID") String id) { public Boolean enableUser(@RequestParam @Valid @NotEmpty(message = "无效的用户ID") String id) {
return this.userService.enableUser(id); return this.userService.enableUser(id);
} }
...@@ -92,6 +94,7 @@ public class UserController { ...@@ -92,6 +94,7 @@ public class UserController {
* @return * @return
*/ */
@PutMapping("/disable") @PutMapping("/disable")
@Security(authorityId = "User.disable")
public Boolean disableUser(@RequestParam @Valid @NotEmpty(message = "无效的用户ID") String id) { public Boolean disableUser(@RequestParam @Valid @NotEmpty(message = "无效的用户ID") String id) {
return this.userService.disableUser(id); return this.userService.disableUser(id);
} }
...@@ -103,18 +106,20 @@ public class UserController { ...@@ -103,18 +106,20 @@ public class UserController {
* @return * @return
*/ */
@DeleteMapping() @DeleteMapping()
@Security(authorityId = "User.delete")
public Boolean removeUser(@RequestParam @Valid @NotEmpty(message = "无效的用户ID") String id) { public Boolean removeUser(@RequestParam @Valid @NotEmpty(message = "无效的用户ID") String id) {
return this.userService.removeUser(id); return this.userService.removeUser(id);
} }
/** /**
* 获取用户详情 * 获取用户详情
* @return *
*/ * @return
@GetMapping("/detail/info") */
public Result<UserDetailInfo> userDetailInfo() { @GetMapping("/detail/info")
return Result.buildSuccess(userService.getUserDetailInfo()); public Result<UserDetailInfo> userDetailInfo() {
} return Result.buildSuccess(userService.getUserDetailInfo());
}
/** /**
* 清除用户活跃订单 * 清除用户活跃订单
...@@ -126,20 +131,20 @@ public class UserController { ...@@ -126,20 +131,20 @@ public class UserController {
@Security(authorityId = "User.cleanUserOrder") @Security(authorityId = "User.cleanUserOrder")
public Result<Boolean> cleanUserOrder(@RequestParam @Valid @NotEmpty(message = "无效的用户手机号") String mobile) { public Result<Boolean> cleanUserOrder(@RequestParam @Valid @NotEmpty(message = "无效的用户手机号") String mobile) {
Tuple<Boolean, String> result = userService.cleanUserActiveOrder(mobile); Tuple<Boolean, String> result = userService.cleanUserActiveOrder(mobile);
return Result.buildSuccess(result.getKey(),result.getValue()); return Result.buildSuccess(result.getKey(), result.getValue());
} }
/** /**
* 清除用户信息 * 清除用户信息
* *
* @param mobile 用户ID * @param mobile 用户ID
* @return * @return
*/ */
@PutMapping("/info/clean") @PutMapping("/info/clean")
@Security(authorityId = "User.cleanUserInfo") @Security(authorityId = "User.cleanUserInfo")
public Boolean deleteByUserId(@RequestParam @Valid @NotEmpty(message = "无效的用户手机号") String mobile) { public Boolean deleteByUserId(@RequestParam @Valid @NotEmpty(message = "无效的用户手机号") String mobile) {
Tuple<Boolean, String> result = this.xyqbUserService.deleteByUserId(mobile); Tuple<Boolean, String> result = this.xyqbUserService.deleteByUserId(mobile);
return result.getKey(); return result.getKey();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment