| | |
| | | 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.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.admin.request.UpdateCompanySortDTO; |
| | | import com.doumee.dao.admin.response.CompanyDTO; |
| | |
| | | import com.doumee.service.business.CompanyService; |
| | | import com.doumee.service.business.ext.ERPSyncService; |
| | | import com.doumee.service.business.impl.hksync.fhk.HkSyncOrgUserFromHKServiceImpl; |
| | | import com.taobao.api.ApiException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:company:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | companyService.deleteById(id,this.getLoginUser()); |
| | | companyService.deleteById(id,this.getLoginUser(null)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | companyService.deleteByIdInBatch(idList,this.getLoginUser()); |
| | | companyService.deleteByIdInBatch(idList,this.getLoginUser(null)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @ApiOperation("组织树查询") |
| | | @GetMapping("/tree") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", dataType = "Integer", value = "类型 0劳务公司 1内部组织", required = true), |
| | | @ApiImplicitParam(name = "type", dataType = "Integer", value = "类型 0劳务公司 1内部组织", required = true) |
| | | }) |
| | | @RequiresPermissions("business:company:query") |
| | | public ApiResponse<List<Company>> tree (@RequestParam Integer type) { |
| | |
| | | return ApiResponse.success(companyService.findCompanyTreePage(type)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("全量部门信息同步") |
| | | @PostMapping("/syncAll") |
| | | @RequiresPermissions("business:company:sync") |
| | |
| | | if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.erp){ |
| | | return ApiResponse.success( erpSyncService.syncCompany(null)); |
| | | }else if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.hk){ |
| | | hkSyncOrgUserFHKService.syncOrgData(); |
| | | hkSyncOrgUserFHKService.syncOrgData(this.getLoginUser(null)); |
| | | return ApiResponse.success("同步成功"); |
| | | }else if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.self){ |
| | | //如果是自建系統,同步安防平台初始化数据 |
| | | hkSyncOrgUserFHKService.syncOrgData(this.getLoginUser(null)); |
| | | return ApiResponse.success("同步成功"); |
| | | } |
| | | return ApiResponse.failed("无效操作"); |