diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/dal/mysql/channel/PayChannelMapper.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/dal/mysql/channel/PayChannelMapper.java index 5be2de26e..f02cf53a7 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/dal/mysql/channel/PayChannelMapper.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/dal/mysql/channel/PayChannelMapper.java @@ -1,14 +1,16 @@ package cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.channel; -import java.util.*; - +import cn.iocoder.yudao.adminserver.modules.pay.controller.channel.vo.PayChannelExportReqVO; +import cn.iocoder.yudao.adminserver.modules.pay.controller.channel.vo.PayChannelPageReqVO; import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayChannelDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.ibatis.annotations.Mapper; -import cn.iocoder.yudao.adminserver.modules.pay.controller.channel.vo.*; + +import java.util.Collection; +import java.util.List; /** * 支付渠道 @@ -53,13 +55,12 @@ public interface PayChannelMapper extends BaseMapperX { * @param code 通道编码 * @return 数量 */ + // TODO @aquan:Mapper 的操作,和 db 保持一致 default Integer getChannelCountByConditions(Long merchantId, Long appid, String code) { - return this.selectCount(new QueryWrapper().lambda() .eq(PayChannelDO::getMerchantId, merchantId) .eq(PayChannelDO::getAppId, appid) - .eq(PayChannelDO::getCode, code) - ); + .eq(PayChannelDO::getCode, code)).intValue(); } /** diff --git a/yudao-admin-server/src/main/resources/application.yaml b/yudao-admin-server/src/main/resources/application.yaml index ada015715..7d54df9ca 100644 --- a/yudao-admin-server/src/main/resources/application.yaml +++ b/yudao-admin-server/src/main/resources/application.yaml @@ -33,7 +33,7 @@ mybatis-plus: logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) mapper-locations: classpath*:mapper/*.xml config-location: classpath:mybatis-config/mybatis-config.xml - configuration-properties: + configuration-properties: # TODO jason:这些配置的作用,要注释下哈 prefix: "" wildcardEscapeClause: "" limitBefore: "" diff --git a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/PayAppServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/PayAppServiceTest.java index 2c760d8bd..7dee06402 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/PayAppServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/PayAppServiceTest.java @@ -6,19 +6,14 @@ import cn.iocoder.yudao.adminserver.modules.pay.controller.app.vo.PayAppCreateRe import cn.iocoder.yudao.adminserver.modules.pay.controller.app.vo.PayAppExportReqVO; import cn.iocoder.yudao.adminserver.modules.pay.controller.app.vo.PayAppPageReqVO; import cn.iocoder.yudao.adminserver.modules.pay.controller.app.vo.PayAppUpdateReqVO; - - import cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.app.PayAppMapper; import cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.merchant.PayMerchantMapper; import cn.iocoder.yudao.adminserver.modules.pay.service.app.impl.PayAppServiceImpl; -import cn.iocoder.yudao.adminserver.modules.pay.service.merchant.PayMerchantService; import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayAppDO; import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayMerchantDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import org.junit.jupiter.api.Test; -import org.mockito.InjectMocks; import org.mockito.Mockito; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; @@ -27,8 +22,9 @@ import javax.annotation.Resource; import java.util.Collections; import java.util.List; -import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.*; +import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.PAY_APP_NOT_FOUND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; @@ -151,19 +147,19 @@ public class PayAppServiceTest extends BaseDbUnitTest { appMapper.insert(dbApp); // 测试 name 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setName("敏敏姐的杂货铺"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setName("敏敏姐的杂货铺"))); // 测试 status 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 remark 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); // 测试 payNotifyUrl 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setPayNotifyUrl("xm.com"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setPayNotifyUrl("xm.com"))); // 测试 refundNotifyUrl 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); // 测试 merchantId 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setMerchantId(mismatchMerchantId))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setMerchantId(mismatchMerchantId))); // 测试 createTime 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); // 准备参数 PayAppPageReqVO reqVO = new PayAppPageReqVO(); reqVO.setName("灿灿姐的杂货铺"); @@ -215,19 +211,19 @@ public class PayAppServiceTest extends BaseDbUnitTest { appMapper.insert(dbApp); // 测试 name 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setName("敏敏姐的杂货铺"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setName("敏敏姐的杂货铺"))); // 测试 status 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 remark 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); // 测试 payNotifyUrl 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setPayNotifyUrl("xm.com"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setPayNotifyUrl("xm.com"))); // 测试 refundNotifyUrl 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); // 测试 merchantId 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setMerchantId(mismatchMerchantId))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setMerchantId(mismatchMerchantId))); // 测试 createTime 不匹配 - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); // 准备参数 PayAppExportReqVO reqVO = new PayAppExportReqVO(); reqVO.setName("灿灿姐的杂货铺"); @@ -246,4 +242,4 @@ public class PayAppServiceTest extends BaseDbUnitTest { assertPojoEquals(dbApp, list.get(0)); } -} \ No newline at end of file +} diff --git a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/PayChannelServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/PayChannelServiceTest.java index 3a0ec740e..b8d2bc917 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/PayChannelServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/PayChannelServiceTest.java @@ -10,7 +10,6 @@ import cn.iocoder.yudao.adminserver.modules.pay.service.channel.impl.PayChannelS import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayChannelDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig; import cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig; import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; @@ -23,6 +22,7 @@ import java.util.List; import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.CHANNEL_NOT_EXISTS; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; @@ -222,37 +222,37 @@ public class PayChannelServiceTest extends BaseDbUnitTest { // 执行拷贝的时候会出现异常,所以在插入后要重置为null 后续在写入新的 dbChannel.setConfig(null); // 测试 code 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setCode(PayChannelEnum.WX_PUB.getCode()); })); // 测试 status 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setStatus(CommonStatusEnum.DISABLE.getStatus()); })); // 测试 remark 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o ->{ + channelMapper.insert(cloneIgnoreId(dbChannel, o ->{ o.setConfig(payClientConfig); o.setRemark("敏敏子的渠道"); })); // 测试 feeRate 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setFeeRate(1.23); })); // 测试 merchantId 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setMerchantId(2L); })); // 测试 appId 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setAppId(2L); })); // 测试 createTime 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setCreateTime(buildTime(2021, 10, 20)); })); @@ -296,37 +296,37 @@ public class PayChannelServiceTest extends BaseDbUnitTest { // 执行拷贝的时候会出现异常,所以在插入后要重置为null 后续在写入新的 dbChannel.setConfig(null); // 测试 code 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setCode(PayChannelEnum.WX_PUB.getCode()); })); // 测试 status 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setStatus(CommonStatusEnum.DISABLE.getStatus()); })); // 测试 remark 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o ->{ + channelMapper.insert(cloneIgnoreId(dbChannel, o ->{ o.setConfig(payClientConfig); o.setRemark("敏敏子的渠道"); })); // 测试 feeRate 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setFeeRate(1.23); })); // 测试 merchantId 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setMerchantId(2L); })); // 测试 appId 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setAppId(2L); })); // 测试 createTime 不匹配 - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { o.setConfig(payClientConfig); o.setCreateTime(buildTime(2021, 10, 20)); })); diff --git a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantServiceTest.java index 154b68591..0e7cf135d 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantServiceTest.java @@ -11,7 +11,6 @@ import cn.iocoder.yudao.adminserver.modules.pay.service.merchant.impl.PayMerchan import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayMerchantDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -19,10 +18,12 @@ import javax.annotation.Resource; import java.util.List; import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.PAY_MERCHANT_NOT_EXISTS; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.*; /** @@ -119,17 +120,17 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { }); merchantMapper.insert(dbMerchant); // 测试 no 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setNo("M200000"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setNo("M200000"))); // 测试 name 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setName("斌哥的杂货铺"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setName("斌哥的杂货铺"))); // 测试 shortName 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setShortName("斌斌子"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setShortName("斌斌子"))); // 测试 status 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 remark 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); // 测试 createTime 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); // 准备参数 PayMerchantPageReqVO reqVO = new PayMerchantPageReqVO(); reqVO.setNo("M1008611"); @@ -161,17 +162,17 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { }); merchantMapper.insert(dbMerchant); // 测试 no 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setNo("M200000"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setNo("M200000"))); // 测试 name 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setName("斌哥的杂货铺"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setName("斌哥的杂货铺"))); // 测试 shortName 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setShortName("斌斌子"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setShortName("斌斌子"))); // 测试 status 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 remark 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); // 测试 createTime 不匹配 - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); // 准备参数 PayMerchantExportReqVO reqVO = new PayMerchantExportReqVO(); reqVO.setNo("M1008611"); diff --git a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/order/PayOrderServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/order/PayOrderServiceTest.java index 21cbdc584..ec33dec4a 100755 --- a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/order/PayOrderServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/service/order/PayOrderServiceTest.java @@ -13,7 +13,6 @@ import cn.iocoder.yudao.coreservice.modules.pay.enums.order.PayOrderStatusEnum; import cn.iocoder.yudao.coreservice.modules.pay.enums.order.PayRefundTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.date.DateUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -22,6 +21,7 @@ import javax.annotation.Resource; import java.util.Date; import java.util.List; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -80,23 +80,23 @@ public class PayOrderServiceTest extends BaseDbUnitTest { }); orderMapper.insert(dbOrder); // 测试 merchantId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantId(2L))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantId(2L))); // 测试 appId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setAppId(2L))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setAppId(2L))); // 测试 channelId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelId(2L))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelId(2L))); // 测试 channelCode 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); // 测试 merchantOrderId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantOrderId(generateNo()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantOrderId(generateNo()))); // 测试 notifyStatus 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); // 测试 status 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); // 测试 refundStatus 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); // 测试 createTime 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, 1)))); // 准备参数 PayOrderPageReqVO reqVO = new PayOrderPageReqVO(); @@ -155,23 +155,23 @@ public class PayOrderServiceTest extends BaseDbUnitTest { }); orderMapper.insert(dbOrder); // 测试 merchantId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantId(2L))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantId(2L))); // 测试 appId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setAppId(2L))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setAppId(2L))); // 测试 channelId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelId(2L))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelId(2L))); // 测试 channelCode 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); // 测试 merchantOrderId 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantOrderId(generateNo()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantOrderId(generateNo()))); // 测试 notifyStatus 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); // 测试 status 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); // 测试 refundStatus 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); // 测试 createTime 不匹配 - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, 1)))); // 准备参数 PayOrderExportReqVO reqVO = new PayOrderExportReqVO(); diff --git a/yudao-admin-ui/src/utils/dict.js b/yudao-admin-ui/src/utils/dict.js index b8075250c..2272fb247 100644 --- a/yudao-admin-ui/src/utils/dict.js +++ b/yudao-admin-ui/src/utils/dict.js @@ -32,7 +32,7 @@ export const DICT_TYPE = { TOOL_CODEGEN_TEMPLATE_TYPE: 'tool_codegen_template_type', OA_LEAVE_STATUS: 'oa_leave_status', - OA_LEAVE_TYPE: 'oa_leave_type' + OA_LEAVE_TYPE: 'oa_leave_type', // 商户状态 PAY_MERCHANT_STATUS: 'pay_merchant_status',