Compare commits

...

7 Commits

Author SHA1 Message Date
xingyu4j 045a336159 fix: JsonGenerator getCurrentValue 已过期 2025-06-02 22:24:02 +08:00
xingyu4j 129f9175ac feat: 优化语句 2025-06-02 21:55:03 +08:00
xingyu4j 4286f16974 fix: RateIntervalUnit 已过期 2025-05-27 10:32:38 +08:00
xingyu4j 0fb8f683c8 fix: getPhoneNoInfo 已过期 2025-05-27 09:33:36 +08:00
xingyu4j 53d8e731cd fix: netty CVE-2025-24970 漏洞 2025-05-26 14:28:59 +08:00
xingyu4j 1b37c47361 fix: deleteBatchIds 已过期 2025-05-26 14:09:31 +08:00
xingyu4j 5caf990920 fix: selectBatchIds 已过期 2025-05-26 14:06:02 +08:00
73 changed files with 155 additions and 169 deletions

View File

@ -64,7 +64,7 @@
<tika-core.version>3.1.0</tika-core.version>
<ip2region.version>2.7.0</ip2region.version>
<bizlog-sdk.version>3.0.6</bizlog-sdk.version>
<netty.version>4.1.116.Final</netty.version>
<netty.version>4.1.118.Final</netty.version>
<mqtt.version>1.2.5</mqtt.version>
<pf4j-spring.version>0.9.0</pf4j-spring.version>
<vertx.version>4.5.13</vertx.version>

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.framework.ratelimiter.core.redis;
import lombok.AllArgsConstructor;
import org.redisson.api.*;
import java.time.Duration;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@ -40,11 +41,13 @@ public class RateLimiterRedisDAO {
String redisKey = formatKey(key);
RRateLimiter rateLimiter = redissonClient.getRateLimiter(redisKey);
long rateInterval = timeUnit.toSeconds(time);
Duration duration = Duration.ofSeconds(rateInterval);
// 1. 如果不存在设置 rate 速率
RateLimiterConfig config = rateLimiter.getConfig();
if (config == null) {
rateLimiter.trySetRate(RateType.OVERALL, count, rateInterval, RateIntervalUnit.SECONDS);
rateLimiter.expire(rateInterval, TimeUnit.SECONDS); // 原因参见 https://t.zsxq.com/lcR0W
rateLimiter.trySetRate(RateType.OVERALL, count, duration);
// 原因参见 https://t.zsxq.com/lcR0W
rateLimiter.expire(duration);
return rateLimiter;
}
// 2. 如果存在并且配置相同则直接返回
@ -54,8 +57,9 @@ public class RateLimiterRedisDAO {
return rateLimiter;
}
// 3. 如果存在并且配置不同则进行新建
rateLimiter.setRate(RateType.OVERALL, count, rateInterval, RateIntervalUnit.SECONDS);
rateLimiter.expire(rateInterval, TimeUnit.SECONDS); // 原因参见 https://t.zsxq.com/lcR0W
rateLimiter.setRate(RateType.OVERALL, count, duration);
// 原因参见 https://t.zsxq.com/lcR0W
rateLimiter.expire(duration);
return rateLimiter;
}

View File

@ -84,7 +84,7 @@ public class StringDesensitizeSerializer extends StdSerializer<String> implement
*/
private Field getField(JsonGenerator generator) {
String currentName = generator.getOutputContext().getCurrentName();
Object currentValue = generator.getCurrentValue();
Object currentValue = generator.currentValue();
Class<?> currentValueClass = currentValue.getClass();
return ReflectUtil.getField(currentValueClass, currentName);
}

View File

@ -162,7 +162,7 @@ public class AiChatConversationServiceImpl implements AiChatConversationService
if (CollUtil.isEmpty(list)) {
return;
}
chatConversationMapper.deleteBatchIds(convertList(list, AiChatConversationDO::getId));
chatConversationMapper.deleteByIds(convertList(list, AiChatConversationDO::getId));
}
@Override

View File

@ -339,7 +339,7 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
throw exception(CHAT_MESSAGE_NOT_EXIST);
}
// 2. 执行删除
chatMessageMapper.deleteBatchIds(convertList(messages, AiChatMessageDO::getId));
chatMessageMapper.deleteByIds(convertList(messages, AiChatMessageDO::getId));
}
@Override

View File

@ -89,7 +89,7 @@ public class AiImageServiceImpl implements AiImageService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return imageMapper.selectBatchIds(ids);
return imageMapper.selectByIds(ids);
}
@Override

View File

@ -200,7 +200,7 @@ public class AiKnowledgeDocumentServiceImpl implements AiKnowledgeDocumentServic
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return knowledgeDocumentMapper.selectBatchIds(ids);
return knowledgeDocumentMapper.selectByIds(ids);
}
@Override

View File

@ -351,7 +351,7 @@ public class AiKnowledgeSegmentServiceImpl implements AiKnowledgeSegmentService
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return segmentMapper.selectBatchIds(ids);
return segmentMapper.selectByIds(ids);
}
}

View File

@ -163,7 +163,7 @@ public class AiChatRoleServiceImpl implements AiChatRoleService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return chatRoleMapper.selectBatchIds(ids);
return chatRoleMapper.selectByIds(ids);
}
@Override

View File

@ -84,7 +84,7 @@ public class AiToolServiceImpl implements AiToolService {
@Override
public List<AiToolDO> getToolList(Collection<Long> ids) {
return toolMapper.selectBatchIds(ids);
return toolMapper.selectByIds(ids);
}
@Override
@ -97,4 +97,4 @@ public class AiToolServiceImpl implements AiToolService {
return toolMapper.selectListByStatus(status);
}
}
}

View File

@ -80,7 +80,7 @@ public class BpmFormServiceImpl implements BpmFormService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return formMapper.selectBatchIds(ids);
return formMapper.selectByIds(ids);
}
@Override

View File

@ -70,7 +70,7 @@ public class BpmUserGroupServiceImpl implements BpmUserGroupService {
@Override
public List<BpmUserGroupDO> getUserGroupList(Collection<Long> ids) {
return userGroupMapper.selectBatchIds(ids);
return userGroupMapper.selectByIds(ids);
}
@ -90,7 +90,7 @@ public class BpmUserGroupServiceImpl implements BpmUserGroupService {
return;
}
// 获得用户组信息
List<BpmUserGroupDO> userGroups = userGroupMapper.selectBatchIds(ids);
List<BpmUserGroupDO> userGroups = userGroupMapper.selectByIds(ids);
Map<Long, BpmUserGroupDO> userGroupMap = convertMap(userGroups, BpmUserGroupDO::getId);
// 校验
ids.forEach(id -> {

View File

@ -180,7 +180,7 @@ public class CrmBusinessServiceImpl implements CrmBusinessService {
businessProductMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
businessProductMapper.deleteBatchIds(convertSet(diffList.get(2), CrmBusinessProductDO::getId));
businessProductMapper.deleteByIds(convertSet(diffList.get(2), CrmBusinessProductDO::getId));
}
}
@ -328,7 +328,7 @@ public class CrmBusinessServiceImpl implements CrmBusinessService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return businessMapper.selectBatchIds(ids);
return businessMapper.selectByIds(ids);
}
@Override

View File

@ -100,7 +100,7 @@ public class CrmBusinessStatusServiceImpl implements CrmBusinessStatusService {
businessStatusMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
businessStatusMapper.deleteBatchIds(convertSet(diffList.get(2), CrmBusinessStatusDO::getId));
businessStatusMapper.deleteByIds(convertSet(diffList.get(2), CrmBusinessStatusDO::getId));
}
}
@ -160,7 +160,7 @@ public class CrmBusinessStatusServiceImpl implements CrmBusinessStatusService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return businessStatusTypeMapper.selectBatchIds(ids);
return businessStatusTypeMapper.selectByIds(ids);
}
@Override
@ -175,7 +175,7 @@ public class CrmBusinessStatusServiceImpl implements CrmBusinessStatusService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return businessStatusMapper.selectBatchIds(ids);
return businessStatusMapper.selectByIds(ids);
}
@Override

View File

@ -262,7 +262,7 @@ public class CrmContactServiceImpl implements CrmContactService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return contactMapper.selectBatchIds(ids);
return contactMapper.selectByIds(ids);
}
@Override
@ -303,4 +303,4 @@ public class CrmContactServiceImpl implements CrmContactService {
return contactMapper.selectListByCustomerIdOwnerUserId(customerId, ownerUserId);
}
}
}

View File

@ -175,7 +175,7 @@ public class CrmContractServiceImpl implements CrmContractService {
contractProductMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
contractProductMapper.deleteBatchIds(convertSet(diffList.get(2), CrmContractProductDO::getId));
contractProductMapper.deleteByIds(convertSet(diffList.get(2), CrmContractProductDO::getId));
}
}
@ -341,7 +341,7 @@ public class CrmContractServiceImpl implements CrmContractService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return contractMapper.selectBatchIds(ids);
return contractMapper.selectByIds(ids);
}
@Override

View File

@ -47,7 +47,6 @@ import java.time.LocalDateTime;
import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.filterList;
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.crm.enums.LogRecordConstants.*;
@ -233,24 +232,18 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
private void transfer(CrmCustomerTransferReqVO reqVO, Long userId) {
if (reqVO.getToBizTypes().contains(CrmBizTypeEnum.CRM_CONTACT.getType())) {
List<CrmContactDO> contactList = contactService.getContactListByCustomerIdOwnerUserId(reqVO.getId(), userId);
contactList.forEach(item -> {
contactService.transferContact(new CrmContactTransferReqVO(item.getId(), reqVO.getNewOwnerUserId(),
reqVO.getOldOwnerPermissionLevel()), userId);
});
contactList.forEach(item -> contactService.transferContact(new CrmContactTransferReqVO(item.getId(), reqVO.getNewOwnerUserId(),
reqVO.getOldOwnerPermissionLevel()), userId));
}
if (reqVO.getToBizTypes().contains(CrmBizTypeEnum.CRM_BUSINESS.getType())) {
List<CrmBusinessDO> businessList = businessService.getBusinessListByCustomerIdOwnerUserId(reqVO.getId(), userId);
businessList.forEach(item -> {
businessService.transferBusiness(new CrmBusinessTransferReqVO(item.getId(), reqVO.getNewOwnerUserId(),
reqVO.getOldOwnerPermissionLevel()), userId);
});
businessList.forEach(item -> businessService.transferBusiness(new CrmBusinessTransferReqVO(item.getId(), reqVO.getNewOwnerUserId(),
reqVO.getOldOwnerPermissionLevel()), userId));
}
if (reqVO.getToBizTypes().contains(CrmBizTypeEnum.CRM_CONTRACT.getType())) {
List<CrmContractDO> contractList = contractService.getContractListByCustomerIdOwnerUserId(reqVO.getId(), userId);
contractList.forEach(item -> {
contractService.transferContract(new CrmContractTransferReqVO(item.getId(), reqVO.getNewOwnerUserId(),
reqVO.getOldOwnerPermissionLevel()), userId);
});
contractList.forEach(item -> contractService.transferContract(new CrmContractTransferReqVO(item.getId(), reqVO.getNewOwnerUserId(),
reqVO.getOldOwnerPermissionLevel()), userId));
}
}
@ -392,7 +385,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
@Transactional(rollbackFor = Exception.class)
public void receiveCustomer(List<Long> ids, Long ownerUserId, Boolean isReceive) {
// 1.1 校验存在
List<CrmCustomerDO> customers = customerMapper.selectBatchIds(ids);
List<CrmCustomerDO> customers = customerMapper.selectByIds(ids);
if (customers.size() != ids.size()) {
throw exception(CUSTOMER_NOT_EXISTS);
}
@ -496,7 +489,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return customerMapper.selectBatchIds(ids);
return customerMapper.selectByIds(ids);
}
@Override

View File

@ -187,7 +187,7 @@ public class CrmPermissionServiceImpl implements CrmPermissionService {
}
private void validatePermissionExists(Collection<Long> ids) {
List<CrmPermissionDO> permissionList = permissionMapper.selectBatchIds(ids);
List<CrmPermissionDO> permissionList = permissionMapper.selectByIds(ids);
if (ObjUtil.notEqual(permissionList.size(), ids.size())) {
throw exception(CRM_PERMISSION_NOT_EXISTS);
}
@ -255,7 +255,7 @@ public class CrmPermissionServiceImpl implements CrmPermissionService {
}
// 删除数据权限
permissionMapper.deleteBatchIds(convertSet(permissions, CrmPermissionDO::getId));
permissionMapper.deleteByIds(convertSet(permissions, CrmPermissionDO::getId));
}
@Override
@ -268,7 +268,7 @@ public class CrmPermissionServiceImpl implements CrmPermissionService {
@Override
public void deletePermissionBatch(Collection<Long> ids, Long userId) {
List<CrmPermissionDO> permissions = permissionMapper.selectBatchIds(ids);
List<CrmPermissionDO> permissions = permissionMapper.selectByIds(ids);
if (CollUtil.isEmpty(permissions)) {
throw exception(CRM_PERMISSION_NOT_EXISTS);
}
@ -286,7 +286,7 @@ public class CrmPermissionServiceImpl implements CrmPermissionService {
}
// 删除数据权限
permissionMapper.deleteBatchIds(ids);
permissionMapper.deleteByIds(ids);
}
@Override

View File

@ -132,7 +132,7 @@ public class CrmProductCategoryServiceImpl implements CrmProductCategoryService
@Override
public List<CrmProductCategoryDO> getProductCategoryList(Collection<Long> ids) {
return productCategoryMapper.selectBatchIds(ids);
return productCategoryMapper.selectByIds(ids);
}
}

View File

@ -158,7 +158,7 @@ public class CrmProductServiceImpl implements CrmProductService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<CrmProductDO> list = productMapper.selectBatchIds(ids);
List<CrmProductDO> list = productMapper.selectByIds(ids);
Map<Long, CrmProductDO> productMap = convertMap(list, CrmProductDO::getId);
for (Long id : ids) {
CrmProductDO product = productMap.get(id);
@ -177,7 +177,7 @@ public class CrmProductServiceImpl implements CrmProductService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return productMapper.selectBatchIds(ids);
return productMapper.selectByIds(ids);
}
}

View File

@ -165,7 +165,7 @@ public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return receivablePlanMapper.selectBatchIds(ids);
return receivablePlanMapper.selectByIds(ids);
}
@Override

View File

@ -277,7 +277,7 @@ public class CrmReceivableServiceImpl implements CrmReceivableService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return receivableMapper.selectBatchIds(ids);
return receivableMapper.selectByIds(ids);
}
@Override

View File

@ -101,7 +101,7 @@ public class ErpAccountServiceImpl implements ErpAccountService {
@Override
public List<ErpAccountDO> getAccountList(Collection<Long> ids) {
return accountMapper.selectBatchIds(ids);
return accountMapper.selectByIds(ids);
}
@Override
@ -109,4 +109,4 @@ public class ErpAccountServiceImpl implements ErpAccountService {
return accountMapper.selectPage(pageReqVO);
}
}
}

View File

@ -189,7 +189,7 @@ public class ErpFinancePaymentServiceImpl implements ErpFinancePaymentService {
financePaymentItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
financePaymentItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpFinancePaymentItemDO::getId));
financePaymentItemMapper.deleteByIds(convertList(diffList.get(2), ErpFinancePaymentItemDO::getId));
}
// 第三步更新采购入库退货的付款金额情况
@ -214,7 +214,7 @@ public class ErpFinancePaymentServiceImpl implements ErpFinancePaymentService {
@Transactional(rollbackFor = Exception.class)
public void deleteFinancePayment(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpFinancePaymentDO> payments = financePaymentMapper.selectBatchIds(ids);
List<ErpFinancePaymentDO> payments = financePaymentMapper.selectByIds(ids);
if (CollUtil.isEmpty(payments)) {
return;
}
@ -230,7 +230,7 @@ public class ErpFinancePaymentServiceImpl implements ErpFinancePaymentService {
financePaymentMapper.deleteById(payment.getId());
// 2.2 删除付款单项
List<ErpFinancePaymentItemDO> paymentItems = financePaymentItemMapper.selectListByPaymentId(payment.getId());
financePaymentItemMapper.deleteBatchIds(convertSet(paymentItems, ErpFinancePaymentItemDO::getId));
financePaymentItemMapper.deleteByIds(convertSet(paymentItems, ErpFinancePaymentItemDO::getId));
// 2.3 更新采购入库退货的付款金额情况
updatePurchasePrice(paymentItems);
@ -270,4 +270,4 @@ public class ErpFinancePaymentServiceImpl implements ErpFinancePaymentService {
return financePaymentItemMapper.selectListByPaymentIds(paymentIds);
}
}
}

View File

@ -189,7 +189,7 @@ public class ErpFinanceReceiptServiceImpl implements ErpFinanceReceiptService {
financeReceiptItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
financeReceiptItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpFinanceReceiptItemDO::getId));
financeReceiptItemMapper.deleteByIds(convertList(diffList.get(2), ErpFinanceReceiptItemDO::getId));
}
// 第三步更新销售出库退货的收款金额情况
@ -214,7 +214,7 @@ public class ErpFinanceReceiptServiceImpl implements ErpFinanceReceiptService {
@Transactional(rollbackFor = Exception.class)
public void deleteFinanceReceipt(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpFinanceReceiptDO> receipts = financeReceiptMapper.selectBatchIds(ids);
List<ErpFinanceReceiptDO> receipts = financeReceiptMapper.selectByIds(ids);
if (CollUtil.isEmpty(receipts)) {
return;
}
@ -230,7 +230,7 @@ public class ErpFinanceReceiptServiceImpl implements ErpFinanceReceiptService {
financeReceiptMapper.deleteById(receipt.getId());
// 2.2 删除收款单项
List<ErpFinanceReceiptItemDO> receiptItems = financeReceiptItemMapper.selectListByReceiptId(receipt.getId());
financeReceiptItemMapper.deleteBatchIds(convertSet(receiptItems, ErpFinanceReceiptItemDO::getId));
financeReceiptItemMapper.deleteByIds(convertSet(receiptItems, ErpFinanceReceiptItemDO::getId));
// 2.3 更新销售出库退货的收款金额情况
updateSalePrice(receiptItems);
@ -270,4 +270,4 @@ public class ErpFinanceReceiptServiceImpl implements ErpFinanceReceiptService {
return financeReceiptItemMapper.selectListByReceiptIds(receiptIds);
}
}
}

View File

@ -143,7 +143,7 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
@Override
public List<ErpProductCategoryDO> getProductCategoryList(Collection<Long> ids) {
return erpProductCategoryMapper.selectBatchIds(ids);
return erpProductCategoryMapper.selectByIds(ids);
}
}
}

View File

@ -72,7 +72,7 @@ public class ErpProductServiceImpl implements ErpProductService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<ErpProductDO> list = productMapper.selectBatchIds(ids);
List<ErpProductDO> list = productMapper.selectByIds(ids);
Map<Long, ErpProductDO> productMap = convertMap(list, ErpProductDO::getId);
for (Long id : ids) {
ErpProductDO product = productMap.get(id);
@ -108,7 +108,7 @@ public class ErpProductServiceImpl implements ErpProductService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<ErpProductDO> list = productMapper.selectBatchIds(ids);
List<ErpProductDO> list = productMapper.selectByIds(ids);
return buildProductVOList(list);
}
@ -144,4 +144,4 @@ public class ErpProductServiceImpl implements ErpProductService {
return productMapper.selectCountByUnitId(unitId);
}
}
}

View File

@ -105,7 +105,7 @@ public class ErpProductUnitServiceImpl implements ErpProductUnitService {
@Override
public List<ErpProductUnitDO> getProductUnitList(Collection<Long> ids) {
return productUnitMapper.selectBatchIds(ids);
return productUnitMapper.selectByIds(ids);
}
}
}

View File

@ -232,7 +232,7 @@ public class ErpPurchaseInServiceImpl implements ErpPurchaseInService {
purchaseInItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
purchaseInItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpPurchaseInItemDO::getId));
purchaseInItemMapper.deleteByIds(convertList(diffList.get(2), ErpPurchaseInItemDO::getId));
}
}
@ -240,7 +240,7 @@ public class ErpPurchaseInServiceImpl implements ErpPurchaseInService {
@Transactional(rollbackFor = Exception.class)
public void deletePurchaseIn(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpPurchaseInDO> purchaseIns = purchaseInMapper.selectBatchIds(ids);
List<ErpPurchaseInDO> purchaseIns = purchaseInMapper.selectByIds(ids);
if (CollUtil.isEmpty(purchaseIns)) {
return;
}
@ -305,4 +305,4 @@ public class ErpPurchaseInServiceImpl implements ErpPurchaseInService {
return purchaseInItemMapper.selectListByInIds(inIds);
}
}
}

View File

@ -183,7 +183,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
purchaseOrderItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
purchaseOrderItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpPurchaseOrderItemDO::getId));
purchaseOrderItemMapper.deleteByIds(convertList(diffList.get(2), ErpPurchaseOrderItemDO::getId));
}
}
@ -231,7 +231,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
@Transactional(rollbackFor = Exception.class)
public void deletePurchaseOrder(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpPurchaseOrderDO> purchaseOrders = purchaseOrderMapper.selectBatchIds(ids);
List<ErpPurchaseOrderDO> purchaseOrders = purchaseOrderMapper.selectByIds(ids);
if (CollUtil.isEmpty(purchaseOrders)) {
return;
}
@ -292,4 +292,4 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
return purchaseOrderItemMapper.selectListByOrderIds(orderIds);
}
}
}

View File

@ -228,7 +228,7 @@ public class ErpPurchaseReturnServiceImpl implements ErpPurchaseReturnService {
purchaseReturnItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
purchaseReturnItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpPurchaseReturnItemDO::getId));
purchaseReturnItemMapper.deleteByIds(convertList(diffList.get(2), ErpPurchaseReturnItemDO::getId));
}
}
@ -236,7 +236,7 @@ public class ErpPurchaseReturnServiceImpl implements ErpPurchaseReturnService {
@Transactional(rollbackFor = Exception.class)
public void deletePurchaseReturn(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpPurchaseReturnDO> purchaseReturns = purchaseReturnMapper.selectBatchIds(ids);
List<ErpPurchaseReturnDO> purchaseReturns = purchaseReturnMapper.selectByIds(ids);
if (CollUtil.isEmpty(purchaseReturns)) {
return;
}
@ -301,4 +301,4 @@ public class ErpPurchaseReturnServiceImpl implements ErpPurchaseReturnService {
return purchaseReturnItemMapper.selectListByReturnIds(returnIds);
}
}
}

View File

@ -78,7 +78,7 @@ public class ErpSupplierServiceImpl implements ErpSupplierService {
@Override
public List<ErpSupplierDO> getSupplierList(Collection<Long> ids) {
return supplierMapper.selectBatchIds(ids);
return supplierMapper.selectByIds(ids);
}
@Override
@ -91,4 +91,4 @@ public class ErpSupplierServiceImpl implements ErpSupplierService {
return supplierMapper.selectListByStatus(status);
}
}
}

View File

@ -81,7 +81,7 @@ public class ErpCustomerServiceImpl implements ErpCustomerService {
@Override
public List<ErpCustomerDO> getCustomerList(Collection<Long> ids) {
return customerMapper.selectBatchIds(ids);
return customerMapper.selectByIds(ids);
}
@Override
@ -94,4 +94,4 @@ public class ErpCustomerServiceImpl implements ErpCustomerService {
return customerMapper.selectListByStatus(status);
}
}
}

View File

@ -195,7 +195,7 @@ public class ErpSaleOrderServiceImpl implements ErpSaleOrderService {
saleOrderItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
saleOrderItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpSaleOrderItemDO::getId));
saleOrderItemMapper.deleteByIds(convertList(diffList.get(2), ErpSaleOrderItemDO::getId));
}
}
@ -243,7 +243,7 @@ public class ErpSaleOrderServiceImpl implements ErpSaleOrderService {
@Transactional(rollbackFor = Exception.class)
public void deleteSaleOrder(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpSaleOrderDO> saleOrders = saleOrderMapper.selectBatchIds(ids);
List<ErpSaleOrderDO> saleOrders = saleOrderMapper.selectByIds(ids);
if (CollUtil.isEmpty(saleOrders)) {
return;
}
@ -304,4 +304,4 @@ public class ErpSaleOrderServiceImpl implements ErpSaleOrderService {
return saleOrderItemMapper.selectListByOrderIds(orderIds);
}
}
}

View File

@ -240,7 +240,7 @@ public class ErpSaleOutServiceImpl implements ErpSaleOutService {
saleOutItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
saleOutItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpSaleOutItemDO::getId));
saleOutItemMapper.deleteByIds(convertList(diffList.get(2), ErpSaleOutItemDO::getId));
}
}
@ -248,7 +248,7 @@ public class ErpSaleOutServiceImpl implements ErpSaleOutService {
@Transactional(rollbackFor = Exception.class)
public void deleteSaleOut(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpSaleOutDO> saleOuts = saleOutMapper.selectBatchIds(ids);
List<ErpSaleOutDO> saleOuts = saleOutMapper.selectByIds(ids);
if (CollUtil.isEmpty(saleOuts)) {
return;
}
@ -313,4 +313,4 @@ public class ErpSaleOutServiceImpl implements ErpSaleOutService {
return saleOutItemMapper.selectListByOutIds(outIds);
}
}
}

View File

@ -240,7 +240,7 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
saleReturnItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
saleReturnItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpSaleReturnItemDO::getId));
saleReturnItemMapper.deleteByIds(convertList(diffList.get(2), ErpSaleReturnItemDO::getId));
}
}
@ -248,7 +248,7 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
@Transactional(rollbackFor = Exception.class)
public void deleteSaleReturn(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpSaleReturnDO> saleReturns = saleReturnMapper.selectBatchIds(ids);
List<ErpSaleReturnDO> saleReturns = saleReturnMapper.selectByIds(ids);
if (CollUtil.isEmpty(saleReturns)) {
return;
}
@ -313,4 +313,4 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
return saleReturnItemMapper.selectListByReturnIds(returnIds);
}
}
}

View File

@ -169,7 +169,7 @@ public class ErpStockCheckServiceImpl implements ErpStockCheckService {
stockCheckItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
stockCheckItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpStockCheckItemDO::getId));
stockCheckItemMapper.deleteByIds(convertList(diffList.get(2), ErpStockCheckItemDO::getId));
}
}
@ -177,7 +177,7 @@ public class ErpStockCheckServiceImpl implements ErpStockCheckService {
@Transactional(rollbackFor = Exception.class)
public void deleteStockCheck(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpStockCheckDO> stockChecks = stockCheckMapper.selectBatchIds(ids);
List<ErpStockCheckDO> stockChecks = stockCheckMapper.selectByIds(ids);
if (CollUtil.isEmpty(stockChecks)) {
return;
}
@ -229,4 +229,4 @@ public class ErpStockCheckServiceImpl implements ErpStockCheckService {
return stockCheckItemMapper.selectListByCheckIds(checkIds);
}
}
}

View File

@ -165,7 +165,7 @@ public class ErpStockInServiceImpl implements ErpStockInService {
stockInItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
stockInItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpStockInItemDO::getId));
stockInItemMapper.deleteByIds(convertList(diffList.get(2), ErpStockInItemDO::getId));
}
}
@ -173,7 +173,7 @@ public class ErpStockInServiceImpl implements ErpStockInService {
@Transactional(rollbackFor = Exception.class)
public void deleteStockIn(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpStockInDO> stockIns = stockInMapper.selectBatchIds(ids);
List<ErpStockInDO> stockIns = stockInMapper.selectByIds(ids);
if (CollUtil.isEmpty(stockIns)) {
return;
}
@ -225,4 +225,4 @@ public class ErpStockInServiceImpl implements ErpStockInService {
return stockInItemMapper.selectListByInIds(inIds);
}
}
}

View File

@ -166,7 +166,7 @@ public class ErpStockMoveServiceImpl implements ErpStockMoveService {
stockMoveItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
stockMoveItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpStockMoveItemDO::getId));
stockMoveItemMapper.deleteByIds(convertList(diffList.get(2), ErpStockMoveItemDO::getId));
}
}
@ -174,7 +174,7 @@ public class ErpStockMoveServiceImpl implements ErpStockMoveService {
@Transactional(rollbackFor = Exception.class)
public void deleteStockMove(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpStockMoveDO> stockMoves = stockMoveMapper.selectBatchIds(ids);
List<ErpStockMoveDO> stockMoves = stockMoveMapper.selectByIds(ids);
if (CollUtil.isEmpty(stockMoves)) {
return;
}
@ -226,4 +226,4 @@ public class ErpStockMoveServiceImpl implements ErpStockMoveService {
return stockMoveItemMapper.selectListByMoveIds(moveIds);
}
}
}

View File

@ -165,7 +165,7 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
stockOutItemMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
stockOutItemMapper.deleteBatchIds(convertList(diffList.get(2), ErpStockOutItemDO::getId));
stockOutItemMapper.deleteByIds(convertList(diffList.get(2), ErpStockOutItemDO::getId));
}
}
@ -173,7 +173,7 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
@Transactional(rollbackFor = Exception.class)
public void deleteStockOut(List<Long> ids) {
// 1. 校验不处于已审批
List<ErpStockOutDO> stockOuts = stockOutMapper.selectBatchIds(ids);
List<ErpStockOutDO> stockOuts = stockOutMapper.selectByIds(ids);
if (CollUtil.isEmpty(stockOuts)) {
return;
}
@ -225,4 +225,4 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
return stockOutItemMapper.selectListByOutIds(outIds);
}
}
}

View File

@ -93,7 +93,7 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<ErpWarehouseDO> list = warehouseMapper.selectBatchIds(ids);
List<ErpWarehouseDO> list = warehouseMapper.selectByIds(ids);
Map<Long, ErpWarehouseDO> warehouseMap = convertMap(list, ErpWarehouseDO::getId);
for (Long id : ids) {
ErpWarehouseDO warehouse = warehouseMap.get(id);
@ -114,7 +114,7 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
@Override
public List<ErpWarehouseDO> getWarehouseList(Collection<Long> ids) {
return warehouseMapper.selectBatchIds(ids);
return warehouseMapper.selectByIds(ids);
}
@Override
@ -122,4 +122,4 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
return warehouseMapper.selectPage(pageReqVO);
}
}
}

View File

@ -204,7 +204,7 @@ public class CodegenServiceImpl implements CodegenService {
codegenColumnMapper.insertBatch(columns);
// 4.2 删除不存在的字段
if (CollUtil.isNotEmpty(deleteColumnIds)) {
codegenColumnMapper.deleteBatchIds(deleteColumnIds);
codegenColumnMapper.deleteByIds(deleteColumnIds);
}
}

View File

@ -155,7 +155,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
@Transactional(rollbackFor = Exception.class)
public void updateDeviceGroup(IotDeviceUpdateGroupReqVO updateReqVO) {
// 1.1 校验设备存在
List<IotDeviceDO> devices = deviceMapper.selectBatchIds(updateReqVO.getIds());
List<IotDeviceDO> devices = deviceMapper.selectByIds(updateReqVO.getIds());
if (CollUtil.isEmpty(devices)) {
return;
}
@ -193,7 +193,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
if (CollUtil.isEmpty(ids)) {
return;
}
List<IotDeviceDO> devices = deviceMapper.selectBatchIds(ids);
List<IotDeviceDO> devices = deviceMapper.selectByIds(ids);
if (CollUtil.isEmpty(devices)) {
return;
}
@ -451,4 +451,4 @@ public class IotDeviceServiceImpl implements IotDeviceService {
));
}
}
}

View File

@ -78,7 +78,7 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService
if (CollUtil.isEmpty(ids)) {
return CollUtil.newArrayList();
}
return iotProductCategoryMapper.selectBatchIds(ids);
return iotProductCategoryMapper.selectByIds(ids);
}
@Override
@ -120,4 +120,4 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService
return categoryDeviceCountMap;
}
}
}

View File

@ -90,7 +90,7 @@ public class ProductBrandServiceImpl implements ProductBrandService {
@Override
public List<ProductBrandDO> getBrandList(Collection<Long> ids) {
return brandMapper.selectBatchIds(ids);
return brandMapper.selectByIds(ids);
}
@Override

View File

@ -109,7 +109,7 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
return;
}
// 获得商品分类信息
List<ProductCategoryDO> list = productCategoryMapper.selectBatchIds(ids);
List<ProductCategoryDO> list = productCategoryMapper.selectByIds(ids);
Map<Long, ProductCategoryDO> categoryMap = CollectionUtils.convertMap(list, ProductCategoryDO::getId);
// 校验
ids.forEach(id -> {

View File

@ -106,7 +106,7 @@ public class ProductPropertyServiceImpl implements ProductPropertyService {
@Override
public List<ProductPropertyDO> getPropertyList(Collection<Long> ids) {
return productPropertyMapper.selectBatchIds(ids);
return productPropertyMapper.selectByIds(ids);
}
@Override

View File

@ -81,7 +81,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return productSkuMapper.selectBatchIds(ids);
return productSkuMapper.selectByIds(ids);
}
@Override
@ -248,7 +248,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
updateSkus.forEach(sku -> productSkuMapper.updateById(sku));
}
if (CollUtil.isNotEmpty(existsSkuMap)) {
productSkuMapper.deleteBatchIds(existsSkuMap.values());
productSkuMapper.deleteByIds(existsSkuMap.values());
}
}
@ -268,7 +268,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
});
// 更新 SPU 库存
List<ProductSkuDO> skus = productSkuMapper.selectBatchIds(
List<ProductSkuDO> skus = productSkuMapper.selectByIds(
convertSet(updateStockReqDTO.getItems(), ProductSkuUpdateStockReqDTO.Item::getId));
Map<Long, Integer> spuStockIncrCounts = ProductSkuConvert.INSTANCE.convertSpuStockMap(
updateStockReqDTO.getItems(), skus);

View File

@ -137,7 +137,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
return Collections.emptyList();
}
// 获得商品信息
List<ProductSpuDO> list = productSpuMapper.selectBatchIds(ids);
List<ProductSpuDO> list = productSpuMapper.selectByIds(ids);
Map<Long, ProductSpuDO> spuMap = CollectionUtils.convertMap(list, ProductSpuDO::getId);
// 校验
ids.forEach(id -> {
@ -202,7 +202,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectBatchIds(ids), ProductSpuDO::getId);
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectByIds(ids), ProductSpuDO::getId);
// 需要按照 ids 顺序返回例如说店铺装修选择了 [3, 1, 2] 三个商品返回结果还是 [3, 1, 2] 这样的顺序
return convertList(ids, spuMap::get);
}

View File

@ -154,7 +154,7 @@ public class BargainActivityServiceImpl implements BargainActivityService {
@Override
public List<BargainActivityDO> getBargainActivityList(Set<Long> ids) {
return bargainActivityMapper.selectBatchIds(ids);
return bargainActivityMapper.selectByIds(ids);
}
@Override

View File

@ -132,7 +132,7 @@ public class CouponTemplateServiceImpl implements CouponTemplateService {
@Override
public List<CouponTemplateDO> getCouponTemplateList(Collection<Long> ids) {
return couponTemplateMapper.selectBatchIds(ids);
return couponTemplateMapper.selectByIds(ids);
}
}

View File

@ -104,7 +104,7 @@ public class DiyPageServiceImpl implements DiyPageService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return diyPageMapper.selectBatchIds(ids);
return diyPageMapper.selectByIds(ids);
}
@Override

View File

@ -132,7 +132,7 @@ public class SeckillConfigServiceImpl implements SeckillConfigService {
return;
}
// 1. 如果有数量不匹配说明有不存在的则抛出 SECKILL_CONFIG_NOT_EXISTS 业务异常
List<SeckillConfigDO> configs = seckillConfigMapper.selectBatchIds(ids);
List<SeckillConfigDO> configs = seckillConfigMapper.selectByIds(ids);
if (configs.size() != ids.size()) {
throw exception(SECKILL_CONFIG_NOT_EXISTS);
}

View File

@ -98,7 +98,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
expressTemplateFreeMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
expressTemplateFreeMapper.deleteBatchIds(convertList(diffList.get(2), DeliveryExpressTemplateFreeDO::getId));
expressTemplateFreeMapper.deleteByIds(convertList(diffList.get(2), DeliveryExpressTemplateFreeDO::getId));
}
}
@ -122,7 +122,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
expressTemplateChargeMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
expressTemplateChargeMapper.deleteBatchIds(convertList(diffList.get(2), DeliveryExpressTemplateChargeDO::getId));
expressTemplateChargeMapper.deleteByIds(convertList(diffList.get(2), DeliveryExpressTemplateChargeDO::getId));
}
}
@ -176,7 +176,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
@Override
public List<DeliveryExpressTemplateDO> getDeliveryExpressTemplateList(Collection<Long> ids) {
return expressTemplateMapper.selectBatchIds(ids);
return expressTemplateMapper.selectByIds(ids);
}
@Override
@ -205,7 +205,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
if (CollUtil.isEmpty(ids)) {
return Collections.emptyMap();
}
List<DeliveryExpressTemplateDO> templateList = expressTemplateMapper.selectBatchIds(ids);
List<DeliveryExpressTemplateDO> templateList = expressTemplateMapper.selectByIds(ids);
// 查询 templateCharge 数组
List<DeliveryExpressTemplateChargeDO> chargeList = expressTemplateChargeMapper.selectByTemplateIds(ids);
// 查询 templateFree 数组

View File

@ -75,7 +75,7 @@ public class DeliveryPickUpStoreServiceImpl implements DeliveryPickUpStoreServic
@Override
public List<DeliveryPickUpStoreDO> getDeliveryPickUpStoreList(Collection<Long> ids) {
return deliveryPickUpStoreMapper.selectBatchIds(ids);
return deliveryPickUpStoreMapper.selectByIds(ids);
}
@Override

View File

@ -84,7 +84,7 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return tradeOrderMapper.selectBatchIds(ids);
return tradeOrderMapper.selectByIds(ids);
}
@Override

View File

@ -87,7 +87,7 @@ public class MemberGroupServiceImpl implements MemberGroupService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return memberGroupMapper.selectBatchIds(ids);
return memberGroupMapper.selectByIds(ids);
}
@Override

View File

@ -169,7 +169,7 @@ public class MemberLevelServiceImpl implements MemberLevelService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return memberLevelMapper.selectBatchIds(ids);
return memberLevelMapper.selectByIds(ids);
}
@Override

View File

@ -109,7 +109,7 @@ public class MemberTagServiceImpl implements MemberTagService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return memberTagMapper.selectBatchIds(ids);
return memberTagMapper.selectByIds(ids);
}
@Override

View File

@ -137,7 +137,7 @@ public class MemberUserServiceImpl implements MemberUserService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return memberUserMapper.selectBatchIds(ids);
return memberUserMapper.selectByIds(ids);
}
@Override

View File

@ -157,7 +157,7 @@ public class MpTagServiceImpl implements MpTagService {
});
// 情况三部分标签已经不存在了删除
if (CollUtil.isNotEmpty(tagMap)) {
mpTagMapper.deleteBatchIds(convertList(tagMap.values(), MpTagDO::getId));
mpTagMapper.deleteByIds(convertList(tagMap.values(), MpTagDO::getId));
}
}

View File

@ -67,7 +67,7 @@ public class MpUserServiceImpl implements MpUserService {
@Override
public List<MpUserDO> getUserList(Collection<Long> ids) {
return mpUserMapper.selectBatchIds(ids);
return mpUserMapper.selectByIds(ids);
}
@Override

View File

@ -121,7 +121,7 @@ public class PayAppServiceImpl implements PayAppService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return appMapper.selectBatchIds(ids);
return appMapper.selectByIds(ids);
}
@Override

View File

@ -89,7 +89,7 @@ public class PayOrderServiceImpl implements PayOrderService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return orderMapper.selectBatchIds(ids);
return orderMapper.selectByIds(ids);
}
@Override

View File

@ -119,23 +119,14 @@ public class OAuth2OpenController {
grantType, scopes, redirectUri);
// 2. 根据授权模式获取访问令牌
OAuth2AccessTokenDO accessTokenDO;
switch (grantTypeEnum) {
case AUTHORIZATION_CODE:
accessTokenDO = oauth2GrantService.grantAuthorizationCodeForAccessToken(client.getClientId(), code, redirectUri, state);
break;
case PASSWORD:
accessTokenDO = oauth2GrantService.grantPassword(username, password, client.getClientId(), scopes);
break;
case CLIENT_CREDENTIALS:
accessTokenDO = oauth2GrantService.grantClientCredentials(client.getClientId(), scopes);
break;
case REFRESH_TOKEN:
accessTokenDO = oauth2GrantService.grantRefreshToken(refreshToken, client.getClientId());
break;
default:
throw new IllegalArgumentException("未知授权类型:" + grantType);
}
OAuth2AccessTokenDO accessTokenDO = switch (grantTypeEnum) {
case AUTHORIZATION_CODE ->
oauth2GrantService.grantAuthorizationCodeForAccessToken(client.getClientId(), code, redirectUri, state);
case PASSWORD -> oauth2GrantService.grantPassword(username, password, client.getClientId(), scopes);
case CLIENT_CREDENTIALS -> oauth2GrantService.grantClientCredentials(client.getClientId(), scopes);
case REFRESH_TOKEN -> oauth2GrantService.grantRefreshToken(refreshToken, client.getClientId());
default -> throw new IllegalArgumentException("未知授权类型:" + grantType);
};
Assert.notNull(accessTokenDO, "访问令牌不能为空"); // 防御性检查
return success(OAuth2OpenConvert.INSTANCE.convert(accessTokenDO));
}

View File

@ -159,7 +159,7 @@ public class DeptServiceImpl implements DeptService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return deptMapper.selectBatchIds(ids);
return deptMapper.selectByIds(ids);
}
@Override

View File

@ -113,7 +113,7 @@ public class PostServiceImpl implements PostService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return postMapper.selectBatchIds(ids);
return postMapper.selectByIds(ids);
}
@Override
@ -137,7 +137,7 @@ public class PostServiceImpl implements PostService {
return;
}
// 获得岗位信息
List<PostDO> posts = postMapper.selectBatchIds(ids);
List<PostDO> posts = postMapper.selectByIds(ids);
Map<Long, PostDO> postMap = convertMap(posts, PostDO::getId);
// 校验
ids.forEach(id -> {

View File

@ -187,7 +187,7 @@ public class MenuServiceImpl implements MenuService {
if (CollUtil.isEmpty(ids)) {
return Lists.newArrayList();
}
return menuMapper.selectBatchIds(ids);
return menuMapper.selectByIds(ids);
}
/**

View File

@ -200,7 +200,7 @@ public class RoleServiceImpl implements RoleService {
if (CollectionUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return roleMapper.selectBatchIds(ids);
return roleMapper.selectByIds(ids);
}
@Override
@ -236,7 +236,7 @@ public class RoleServiceImpl implements RoleService {
return;
}
// 获得角色信息
List<RoleDO> roles = roleMapper.selectBatchIds(ids);
List<RoleDO> roles = roleMapper.selectByIds(ids);
Map<Long, RoleDO> roleMap = convertMap(roles, RoleDO::getId);
// 校验
ids.forEach(id -> {

View File

@ -262,9 +262,9 @@ public class SocialClientServiceImpl implements SocialClientService {
public WxMaPhoneNumberInfo getWxMaPhoneNumberInfo(Integer userType, String phoneCode) {
WxMaService service = getWxMaService(userType);
try {
return service.getUserService().getPhoneNoInfo(phoneCode);
return service.getUserService().getPhoneNumber(phoneCode);
} catch (WxErrorException e) {
log.error("[getPhoneNoInfo][userType({}) phoneCode({}) 获得手机号失败]", userType, phoneCode, e);
log.error("[getPhoneNumber][userType({}) phoneCode({}) 获得手机号失败]", userType, phoneCode, e);
throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_PHONE_CODE_ERROR);
}
}
@ -474,7 +474,6 @@ public class SocialClientServiceImpl implements SocialClientService {
/**
* 校验社交应用是否重复需要保证 userType + socialType 唯一
*
* 原因是不同端userType选择某个社交登录socialType需要通过 {@link #buildAuthRequest(Integer, Integer)} 构建对应的请求
*
* @param id 编号

View File

@ -54,7 +54,7 @@ public class SocialUserServiceImpl implements SocialUserService {
return Collections.emptyList();
}
// 获得社交用户
return socialUserMapper.selectBatchIds(convertSet(socialUserBinds, SocialUserBindDO::getSocialUserId));
return socialUserMapper.selectByIds(convertSet(socialUserBinds, SocialUserBindDO::getSocialUserId));
}
@Override

View File

@ -12,7 +12,6 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthRegisterReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
@ -291,7 +290,7 @@ public class AdminUserServiceImpl implements AdminUserService {
if (CollUtil.isEmpty(userIds)) {
return Collections.emptyList();
}
return userMapper.selectBatchIds(userIds);
return userMapper.selectByIds(userIds);
}
@Override
@ -299,7 +298,7 @@ public class AdminUserServiceImpl implements AdminUserService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return userMapper.selectBatchIds(ids);
return userMapper.selectByIds(ids);
}
@Override
@ -308,7 +307,7 @@ public class AdminUserServiceImpl implements AdminUserService {
return;
}
// 获得岗位信息
List<AdminUserDO> users = userMapper.selectBatchIds(ids);
List<AdminUserDO> users = userMapper.selectByIds(ids);
Map<Long, AdminUserDO> userMap = CollectionUtils.convertMap(users, AdminUserDO::getId);
// 校验
ids.forEach(id -> {

View File

@ -274,7 +274,7 @@ public class SocialClientServiceImplTest extends BaseDbUnitTest {
WxMaUserService userService = mock(WxMaUserService.class);
when(wxMaService.getUserService()).thenReturn(userService);
WxMaPhoneNumberInfo phoneNumber = randomPojo(WxMaPhoneNumberInfo.class);
when(userService.getPhoneNoInfo(eq(phoneCode))).thenReturn(phoneNumber);
when(userService.getPhoneNumber(eq(phoneCode))).thenReturn(phoneNumber);
// 调用
WxMaPhoneNumberInfo result = socialClientService.getWxMaPhoneNumberInfo(userType, phoneCode);
@ -291,7 +291,7 @@ public class SocialClientServiceImplTest extends BaseDbUnitTest {
WxMaUserService userService = mock(WxMaUserService.class);
when(wxMaService.getUserService()).thenReturn(userService);
WxErrorException wxErrorException = new WxErrorException(new NullPointerException());
when(userService.getPhoneNoInfo(eq(phoneCode))).thenThrow(wxErrorException);
when(userService.getPhoneNumber(eq(phoneCode))).thenThrow(wxErrorException);
// 调用并断言异常
assertServiceException(() -> socialClientService.getWxMaPhoneNumberInfo(userType, phoneCode),