|
@ -52,7 +52,7 @@ public class WorkbenchController { |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("getCard") |
|
|
@PostMapping("getCard") |
|
|
public ResponseEntity<WorkbenchCard> card1(@RequestBody WorkbenchCard workbench, |
|
|
public ResponseEntity<WorkbenchCard> card1(@RequestBody WorkbenchCard workbench, |
|
|
@AuthenticationPrincipal Admin admin) throws Exception{ |
|
|
|
|
|
|
|
|
@AuthenticationPrincipal Admin admin) { |
|
|
if (admin == null) { |
|
|
if (admin == null) { |
|
|
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null); |
|
|
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null); |
|
|
} |
|
|
} |
|
@ -74,7 +74,15 @@ public class WorkbenchController { |
|
|
获取各地区工作台图表的数据 |
|
|
获取各地区工作台图表的数据 |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("getGraph") |
|
|
@PostMapping("getGraph") |
|
|
public ResponseEntity<WorkbenchCard> graph1(@RequestBody WorkbenchCard workbench){ |
|
|
|
|
|
|
|
|
public ResponseEntity<WorkbenchCard> graph1(@RequestBody WorkbenchCard workbench, @AuthenticationPrincipal Admin admin) { |
|
|
|
|
|
String account = admin.getAccount(); |
|
|
|
|
|
List<String> markets = generalService.getRoleMarket(account); |
|
|
|
|
|
|
|
|
|
|
|
//判断是否是总部 |
|
|
|
|
|
if (markets != null && markets.contains("总部")) { |
|
|
|
|
|
markets=generalService.getMarket();//总部有所有地区的权限 |
|
|
|
|
|
} |
|
|
|
|
|
workbench.setMarkets(markets); |
|
|
WorkbenchCard result =workbenchService.getGraph(workbench.getStartDate(),workbench.getEndDate(),workbench.getMarkets()); |
|
|
WorkbenchCard result =workbenchService.getGraph(workbench.getStartDate(),workbench.getEndDate(),workbench.getMarkets()); |
|
|
return ResponseEntity.ok(result); |
|
|
return ResponseEntity.ok(result); |
|
|
} |
|
|
} |
|
|