| package com.doumee.api.business; | 
|   | 
| import com.doumee.api.BaseController; | 
| import com.doumee.core.annotation.pr.PreventRepeat; | 
| import com.doumee.core.erp.model.openapi.request.erp.OrgListRequest; | 
| import com.doumee.core.erp.model.openapi.request.erp.UserListRequest; | 
| import com.doumee.core.model.ApiResponse; | 
| import com.doumee.service.business.ext.ERPSyncService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiOperation; | 
| import org.apache.shiro.authz.annotation.RequiresPermissions; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.PostMapping; | 
| import org.springframework.web.bind.annotation.RequestBody; | 
| import org.springframework.web.bind.annotation.RequestMapping; | 
| import org.springframework.web.bind.annotation.RestController; | 
|   | 
| /** | 
|  * @author 江蹄蹄 | 
|  * @date 2023/11/30 15:33 | 
|  */ | 
| @Api(tags = "ERP数据同步接口") | 
| @RestController | 
| @RequestMapping("/business/erpsync") | 
| public class ERPSyncController extends BaseController { | 
|     @Autowired | 
|     private ERPSyncService erpSyncService; | 
|   | 
|     @PreventRepeat | 
|     @ApiOperation("【ERP】全量同步ERP组织接口") | 
|     @PostMapping("/getCompanies") | 
|     @RequiresPermissions("business:erpsync:company") | 
|     public ApiResponse getCompanies(@RequestBody OrgListRequest param) { | 
|         String result = erpSyncService.syncCompany(param); | 
|         return ApiResponse.success(result); | 
|     } | 
|     @PreventRepeat | 
|     @ApiOperation("【ERP】全量同步ERP人员接口") | 
|     @PostMapping("/getUsers") | 
|     @RequiresPermissions("business:erpsync:users") | 
|     public ApiResponse getUsers(@RequestBody UserListRequest param) { | 
|         String result = erpSyncService.syncUsers(param); | 
|         return ApiResponse.success(result); | 
|     } | 
| } |