|  |  |  | 
|---|
|  |  |  | package com.doumee.api; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.config.DataSyncConfig; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.service.business.MemberService; | 
|---|
|  |  |  | import com.doumee.service.business.impl.hksync.HkSyncDeviceServiceImpl; | 
|---|
|  |  |  | import com.doumee.service.business.impl.hksync.ferp.HkSyncOrgUserToHKServiceImpl; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | private DataSyncConfig dataSyncConfig; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("开启定时同步海康组织数据") | 
|---|
|  |  |  | @GetMapping("/syncOrgData") | 
|---|
|  |  |  | @PostMapping("/syncOrgData") | 
|---|
|  |  |  | public ApiResponse syncOrgData() { | 
|---|
|  |  |  | log.info("=========================开启定时同步海康组织数据===========start==========="); | 
|---|
|  |  |  | if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.erp | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success("开启定时同步海康组织数据成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("开启定时重新下发删除人员数据") | 
|---|
|  |  |  | @GetMapping("/syncMemberDelData") | 
|---|
|  |  |  | @PostMapping("/syncMemberDelData") | 
|---|
|  |  |  | public ApiResponse syncMemberDelData() { | 
|---|
|  |  |  | log.info("=========================开启定时重新下发删除人员数据===========start==========="); | 
|---|
|  |  |  | hkSyncOrgUserService.syncMemberDelData(); | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success("开启定时重新下发删除人员数据成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("开启定时同步海康人员数据") | 
|---|
|  |  |  | @GetMapping("/syncUserData") | 
|---|
|  |  |  | @PostMapping("/syncUserData") | 
|---|
|  |  |  | public ApiResponse syncUserData() { | 
|---|
|  |  |  | log.info("=========================开启定时同步海康人员数据===========start==========="); | 
|---|
|  |  |  | if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.erp | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success("开启定时同步海康人员数据成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("开启定时冻结人员") | 
|---|
|  |  |  | @GetMapping("/memberFreeze") | 
|---|
|  |  |  | @PostMapping("/memberFreeze") | 
|---|
|  |  |  | public ApiResponse memberFreeze() { | 
|---|
|  |  |  | memberService.memberFreeze(); | 
|---|
|  |  |  | return ApiResponse.success("开启定时冻结人员成功"); | 
|---|