|  |  |  | 
|---|
|  |  |  | import com.doumee.service.business.impl.hksync.HkSyncBaseServiceImpl; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.data.redis.core.RedisTemplate; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public   void syncOrgData(){ | 
|---|
|  |  |  | public   void syncOrgData(LoginUserInfo user){ | 
|---|
|  |  |  | if(Constants.DEALING_HK_ORG){ | 
|---|
|  |  |  | return ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if( Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) != DataSyncConfig.origin.hk){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,当前不支持组织同步操作~"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LoginUserInfo user =  (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | TimeRangeListRequest param = new TimeRangeListRequest(); | 
|---|
|  |  |  | //获取ERP组织信息(全量同步) | 
|---|
|  |  |  | boolean hasNext = true; | 
|---|
|  |  |  | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未同步到任何组织信息!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | companyMapper.delete(new UpdateWrapper<>());//清空原有数据 | 
|---|
|  |  |  | companyMapper.insertBatchSomeColumn(allHkList);//插入新数据 | 
|---|
|  |  |  | companyMapper.insert(allHkList);//插入新数据 | 
|---|
|  |  |  | }catch (BusinessException e){ | 
|---|
|  |  |  | throw  e; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public   void syncUserData(){ | 
|---|
|  |  |  | public   void syncUserData(LoginUserInfo user){ | 
|---|
|  |  |  | if(Constants.DEALING_HK_USER){ | 
|---|
|  |  |  | return   ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if( Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) != DataSyncConfig.origin.hk){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,当前不支持组织同步操作~"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LoginUserInfo user =  (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | List<Company> companies = companyMapper.selectList(new QueryWrapper<>()); | 
|---|
|  |  |  | if(companies == null || companies.size() == 0){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,请先同步企业组织信息~"); | 
|---|
|  |  |  | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未同步到任何组织信息!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | memberMapper.delete(new UpdateWrapper<>());//清空原有数据 | 
|---|
|  |  |  | memberMapper.insertBatchSomeColumn(allHkList);//插入新数据 | 
|---|
|  |  |  | memberMapper.insert(allHkList);//插入新数据 | 
|---|
|  |  |  | }catch (BusinessException e){ | 
|---|
|  |  |  | throw  e; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|