| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.DataSyncConfig; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | |
| | | import com.doumee.dao.admin.request.UpdateCompanySortDTO; |
| | | import com.doumee.dao.admin.response.CompanyDTO; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.system.dto.UpdateSystemMenuSortDTO; |
| | | import com.doumee.service.business.CompanyService; |
| | | import com.doumee.service.business.ERPSyncService; |
| | | import com.doumee.service.business.ext.ERPSyncService; |
| | | import com.doumee.service.business.impl.hksync.fhk.HkSyncOrgUserFromHKServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | @Autowired |
| | | private ERPSyncService erpSyncService; |
| | | @Autowired |
| | | private HkSyncOrgUserFromHKServiceImpl hkSyncOrgUserFHKService; |
| | | @Autowired |
| | | private DataSyncConfig dataSyncConfig; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation("部门信息同步") |
| | | @PostMapping("/sync") |
| | | @ApiOperation("全量部门信息同步") |
| | | @PostMapping("/syncAll") |
| | | @RequiresPermissions("business:company:sync") |
| | | public ApiResponse sync(){ |
| | | erpSyncService.syncCompany(null); |
| | | if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.erp){ |
| | | erpSyncService.syncCompany(null); |
| | | }else if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.hk){ |
| | | hkSyncOrgUserFHKService.syncOrgData(); |
| | | } |
| | | return ApiResponse.success("同步成功"); |
| | | } |
| | | } |