|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.request.ParkListRequest; | 
|---|
|  |  |  | 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.impl.hksync.HkSyncDeviceServiceImpl; | 
|---|
|  |  |  | import com.doumee.service.business.impl.hksync.HkSyncParkServiceImpl; | 
|---|
|  |  |  | import com.doumee.service.business.impl.hksync.HkSyncPrivilegeServiceImpl; | 
|---|
|  |  |  | import com.doumee.service.business.ext.ERPSyncService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/business/erpsync") | 
|---|
|  |  |  | public class ERPSyncController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private HkSyncDeviceServiceImpl hkSyncDeviceService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private HkSyncParkServiceImpl hkSyncParkService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private HkSyncPrivilegeServiceImpl hkSyncPrivilegeService; | 
|---|
|  |  |  | private ERPSyncService erpSyncService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("【ERP】全量同步门禁设备接口") | 
|---|
|  |  |  | @PostMapping("/syncDevices") | 
|---|
|  |  |  | //@RequiresPermissions("business:erpsync:device") | 
|---|
|  |  |  | public ApiResponse getDevices(@RequestBody AcsDeviceListRequest param) { | 
|---|
|  |  |  | String result = hkSyncDeviceService.syncHkDevices(param); | 
|---|
|  |  |  | @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("【海康】全量同步停车库接口") | 
|---|
|  |  |  | @PostMapping("/getParks") | 
|---|
|  |  |  | //    @RequiresPermissions("business:hksync:park") | 
|---|
|  |  |  | public ApiResponse getParks(@RequestBody ParkListRequest param) { | 
|---|
|  |  |  | String result = hkSyncParkService.syncHkParks(param); | 
|---|
|  |  |  | return ApiResponse.success(result); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("【海康】全量同步停车库接口") | 
|---|
|  |  |  | @PostMapping("/getPrivilege") | 
|---|
|  |  |  | //    @RequiresPermissions("business:hksync:privilege") | 
|---|
|  |  |  | public ApiResponse getPrivilege(@RequestBody ParkListRequest param) { | 
|---|
|  |  |  | String result = hkSyncPrivilegeService.syncHkParks(param); | 
|---|
|  |  |  | @ApiOperation("【ERP】全量同步ERP人员接口") | 
|---|
|  |  |  | @PostMapping("/getUsers") | 
|---|
|  |  |  | @RequiresPermissions("business:erpsync:users") | 
|---|
|  |  |  | public ApiResponse getUsers(@RequestBody UserListRequest param) { | 
|---|
|  |  |  | String result = erpSyncService.syncUsers(param); | 
|---|
|  |  |  | return ApiResponse.success(result); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|