| | |
| | | package com.ruoyi.quartz.task; |
| | | |
| | | import com.ruoyi.system.domain.DepartmentSyncDTO; |
| | | import com.ruoyi.system.domain.OrderClassDTO; |
| | | import com.ruoyi.system.domain.UserSyncDTO; |
| | | import com.ruoyi.system.service.IDepartmentSyncDataService; |
| | | import com.ruoyi.system.service.IUserSyncDataService; |
| | | import com.ruoyi.system.service.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.system.service.IDepartmentSyncService; |
| | | import com.ruoyi.system.service.IUserSyncService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * OA数据同步定时任务(组合任务) |
| | |
| | | private List<UserSyncDTO> getUserData(){ |
| | | return userSyncDataService.getOaUsers(); |
| | | } |
| | | |
| | | @Autowired |
| | | private IOrderClassDataService orderClassDataService; |
| | | private List<OrderClassDTO> getServiceOrdCode() { |
| | | return orderClassDataService.getServiceOrderClass(); |
| | | } |
| | | private List<OrderClassDTO> getDispatchOrdCode() { |
| | | return orderClassDataService.getDispatchOrderClass(); |
| | | } |
| | | |
| | | private List<Map<String,Object>> getAddressList() { |
| | | return departmentSyncDataService.getAddressList(); |
| | | } |
| | | /** |
| | | * 同步OA数据(部门+用户) |
| | | * 按顺序执行:1. 部门同步 2. 用户同步 |
| | |
| | | |
| | | // 第一步:同步部门 |
| | | log.info("【步骤1/2】开始同步部门数据..."); |
| | | AjaxResult deptResult = departmentSyncService.syncBranchDepartments(this.getDept()); |
| | | AjaxResult deptResult = departmentSyncService.syncBranchDepartments(this.getDept(),this.getServiceOrdCode(),this.getDispatchOrdCode(),this.getAddressList()); |
| | | |
| | | if (deptResult.get("code").equals(200)) |
| | | { |
| | |
| | | try |
| | | { |
| | | log.info("==========开始执行部门同步任务=========="); |
| | | AjaxResult result = departmentSyncService.syncBranchDepartments(this.getDept()); |
| | | AjaxResult result = departmentSyncService.syncBranchDepartments(this.getDept(),this.getServiceOrdCode(),this.getDispatchOrdCode(),this.getAddressList()); |
| | | |
| | | if (result.get("code").equals(200)) |
| | | { |