Compare commits
No commits in common. "a25bd59e00b3e0904daeb6d089e6bad06b9d8490" and "f0ab7b7b9d251312780ed49f106516699dc059c6" have entirely different histories.
a25bd59e00
...
f0ab7b7b9d
@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||||
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
|
|
||||||
import cn.iocoder.yudao.module.system.api.auth.dto.AdminOauthUserOtherInfoApiDTO;
|
import cn.iocoder.yudao.module.system.api.auth.dto.AdminOauthUserOtherInfoApiDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.auth.vo.AdminOauthUserOtherInfoApiVO;
|
import cn.iocoder.yudao.module.system.api.auth.vo.AdminOauthUserOtherInfoApiVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.auth.AdminOauthUserOtherInfoDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.auth.AdminOauthUserOtherInfoDO;
|
||||||
@ -14,9 +13,7 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
|
||||||
|
|
||||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||||
@Validated
|
@Validated
|
||||||
@ -27,24 +24,20 @@ public class AdminOauthUserOtherInfoApiImpl implements AdminOauthUserOtherInfoAp
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@DataPermission(enable = false)
|
||||||
public CommonResult<List<AdminOauthUserOtherInfoApiVO>> getOpenIdByCondition(AdminOauthUserOtherInfoApiDTO dto) {
|
public CommonResult<List<AdminOauthUserOtherInfoApiVO>> getOpenIdByCondition(AdminOauthUserOtherInfoApiDTO dto) {
|
||||||
AdminOauthUserOtherInfoDTO adminOauthUserOtherInfoDTO = BeanUtil.copyProperties(dto, AdminOauthUserOtherInfoDTO.class);
|
AdminOauthUserOtherInfoDTO adminOauthUserOtherInfoDTO = BeanUtil.copyProperties(dto, AdminOauthUserOtherInfoDTO.class);
|
||||||
AtomicReference<List<AdminOauthUserOtherInfoDO>> list = new AtomicReference<>(new ArrayList<>());
|
List<AdminOauthUserOtherInfoDO> list = adminOauthUserOtherInfoService.getOpenIdByCondition(adminOauthUserOtherInfoDTO);
|
||||||
DataPermissionUtils.executeIgnore(
|
return CommonResult.success(BeanUtil.copyToList(list, AdminOauthUserOtherInfoApiVO.class));
|
||||||
() -> list.set(adminOauthUserOtherInfoService.getOpenIdByCondition(adminOauthUserOtherInfoDTO))
|
|
||||||
);
|
|
||||||
return CommonResult.success(BeanUtil.copyToList(list.get(), AdminOauthUserOtherInfoApiVO.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@DataPermission(enable = false)
|
||||||
public CommonResult<AdminOauthUserOtherInfoApiVO> getByCondition(AdminOauthUserOtherInfoApiDTO dto) {
|
public CommonResult<AdminOauthUserOtherInfoApiVO> getByCondition(AdminOauthUserOtherInfoApiDTO dto) {
|
||||||
AdminOauthUserOtherInfoDTO adminOauthUserOtherInfoDTO = BeanUtil.copyProperties(dto, AdminOauthUserOtherInfoDTO.class);
|
AdminOauthUserOtherInfoDTO adminOauthUserOtherInfoDTO = BeanUtil.copyProperties(dto, AdminOauthUserOtherInfoDTO.class);
|
||||||
AtomicReference<List<AdminOauthUserOtherInfoDO>> list = new AtomicReference<>(new ArrayList<>());
|
List<AdminOauthUserOtherInfoDO> list = adminOauthUserOtherInfoService.getOpenIdByCondition(adminOauthUserOtherInfoDTO);
|
||||||
DataPermissionUtils.executeIgnore(
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
() -> list.set(adminOauthUserOtherInfoService.getOpenIdByCondition(adminOauthUserOtherInfoDTO))
|
return CommonResult.success(BeanUtil.copyProperties(list.get(0), AdminOauthUserOtherInfoApiVO.class));
|
||||||
);
|
|
||||||
if (CollUtil.isNotEmpty(list.get())) {
|
|
||||||
return CommonResult.success(BeanUtil.copyProperties(list.get().get(0), AdminOauthUserOtherInfoApiVO.class));
|
|
||||||
}
|
}
|
||||||
return CommonResult.success(null);
|
return CommonResult.success(null);
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
Boolean flag = stringRedisTemplate.hasKey(key);
|
Boolean flag = stringRedisTemplate.hasKey(key);
|
||||||
// 缓存不存在
|
// 缓存不存在
|
||||||
if (Boolean.FALSE.equals(flag)) {
|
if (Boolean.FALSE.equals(flag)) {
|
||||||
String url = "http://timor.tech/api/holiday/year/" + year;
|
String url = "https://timor.tech/api/holiday/year/" + year;
|
||||||
String json = HttpUtil.get(url, 3000);
|
String json = HttpUtil.get(url, 3000);
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(json);
|
JSONObject jsonObject = JSONUtil.parseObj(json);
|
||||||
@ -1190,7 +1190,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
Boolean flag = stringRedisTemplate.hasKey(key);
|
Boolean flag = stringRedisTemplate.hasKey(key);
|
||||||
// 缓存不存在
|
// 缓存不存在
|
||||||
if (Boolean.FALSE.equals(flag)) {
|
if (Boolean.FALSE.equals(flag)) {
|
||||||
String url = "http://timor.tech/api/holiday/year/" + year;
|
String url = "https://timor.tech/api/holiday/year/" + year;
|
||||||
String json = HttpUtil.get(url, 3000);
|
String json = HttpUtil.get(url, 3000);
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(json);
|
JSONObject jsonObject = JSONUtil.parseObj(json);
|
||||||
|
Loading…
Reference in New Issue
Block a user