Commit be0b47ecb73822580105b56a75baefd6e6ec2989
1 parent
c916b30f
合并 master 最新的代码
Showing
7 changed files
with
77 additions
and
79 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/dal/mysql/channel/PayChannelMapper.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.channel; |
| 2 | 2 | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 3 | +import cn.iocoder.yudao.adminserver.modules.pay.controller.channel.vo.PayChannelExportReqVO; | |
| 4 | +import cn.iocoder.yudao.adminserver.modules.pay.controller.channel.vo.PayChannelPageReqVO; | |
| 5 | 5 | import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayChannelDO; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | |
| 8 | 7 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | |
| 9 | 9 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 10 | 10 | import org.apache.ibatis.annotations.Mapper; |
| 11 | -import cn.iocoder.yudao.adminserver.modules.pay.controller.channel.vo.*; | |
| 11 | + | |
| 12 | +import java.util.Collection; | |
| 13 | +import java.util.List; | |
| 12 | 14 | |
| 13 | 15 | /** |
| 14 | 16 | * 支付渠道 |
| ... | ... | @@ -53,13 +55,12 @@ public interface PayChannelMapper extends BaseMapperX<PayChannelDO> { |
| 53 | 55 | * @param code 通道编码 |
| 54 | 56 | * @return 数量 |
| 55 | 57 | */ |
| 58 | + // TODO @aquan:Mapper 的操作,和 db 保持一致 | |
| 56 | 59 | default Integer getChannelCountByConditions(Long merchantId, Long appid, String code) { |
| 57 | - | |
| 58 | 60 | return this.selectCount(new QueryWrapper<PayChannelDO>().lambda() |
| 59 | 61 | .eq(PayChannelDO::getMerchantId, merchantId) |
| 60 | 62 | .eq(PayChannelDO::getAppId, appid) |
| 61 | - .eq(PayChannelDO::getCode, code) | |
| 62 | - ); | |
| 63 | + .eq(PayChannelDO::getCode, code)).intValue(); | |
| 63 | 64 | } |
| 64 | 65 | |
| 65 | 66 | /** | ... | ... |
yudao-admin-server/src/main/resources/application.yaml
| ... | ... | @@ -33,7 +33,7 @@ mybatis-plus: |
| 33 | 33 | logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) |
| 34 | 34 | mapper-locations: classpath*:mapper/*.xml |
| 35 | 35 | config-location: classpath:mybatis-config/mybatis-config.xml |
| 36 | - configuration-properties: | |
| 36 | + configuration-properties: # TODO jason:这些配置的作用,要注释下哈 | |
| 37 | 37 | prefix: "" |
| 38 | 38 | wildcardEscapeClause: "" |
| 39 | 39 | limitBefore: "" | ... | ... |
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 |
| 6 | 6 | import cn.iocoder.yudao.adminserver.modules.pay.controller.app.vo.PayAppExportReqVO; |
| 7 | 7 | import cn.iocoder.yudao.adminserver.modules.pay.controller.app.vo.PayAppPageReqVO; |
| 8 | 8 | import cn.iocoder.yudao.adminserver.modules.pay.controller.app.vo.PayAppUpdateReqVO; |
| 9 | - | |
| 10 | - | |
| 11 | 9 | import cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.app.PayAppMapper; |
| 12 | 10 | import cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.merchant.PayMerchantMapper; |
| 13 | 11 | import cn.iocoder.yudao.adminserver.modules.pay.service.app.impl.PayAppServiceImpl; |
| 14 | -import cn.iocoder.yudao.adminserver.modules.pay.service.merchant.PayMerchantService; | |
| 15 | 12 | import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayAppDO; |
| 16 | 13 | import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayMerchantDO; |
| 17 | 14 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 18 | 15 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 19 | -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; | |
| 20 | 16 | import org.junit.jupiter.api.Test; |
| 21 | -import org.mockito.InjectMocks; | |
| 22 | 17 | import org.mockito.Mockito; |
| 23 | 18 | import org.springframework.boot.test.mock.mockito.MockBean; |
| 24 | 19 | import org.springframework.context.annotation.Import; |
| ... | ... | @@ -27,8 +22,9 @@ import javax.annotation.Resource; |
| 27 | 22 | import java.util.Collections; |
| 28 | 23 | import java.util.List; |
| 29 | 24 | |
| 30 | -import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.*; | |
| 25 | +import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.PAY_APP_NOT_FOUND; | |
| 31 | 26 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; |
| 27 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 32 | 28 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 33 | 29 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; |
| 34 | 30 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; |
| ... | ... | @@ -151,19 +147,19 @@ public class PayAppServiceTest extends BaseDbUnitTest { |
| 151 | 147 | |
| 152 | 148 | appMapper.insert(dbApp); |
| 153 | 149 | // 测试 name 不匹配 |
| 154 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setName("敏敏姐的杂货铺"))); | |
| 150 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setName("敏敏姐的杂货铺"))); | |
| 155 | 151 | // 测试 status 不匹配 |
| 156 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 152 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 157 | 153 | // 测试 remark 不匹配 |
| 158 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); | |
| 154 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); | |
| 159 | 155 | // 测试 payNotifyUrl 不匹配 |
| 160 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setPayNotifyUrl("xm.com"))); | |
| 156 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setPayNotifyUrl("xm.com"))); | |
| 161 | 157 | // 测试 refundNotifyUrl 不匹配 |
| 162 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); | |
| 158 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); | |
| 163 | 159 | // 测试 merchantId 不匹配 |
| 164 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setMerchantId(mismatchMerchantId))); | |
| 160 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setMerchantId(mismatchMerchantId))); | |
| 165 | 161 | // 测试 createTime 不匹配 |
| 166 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); | |
| 162 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); | |
| 167 | 163 | // 准备参数 |
| 168 | 164 | PayAppPageReqVO reqVO = new PayAppPageReqVO(); |
| 169 | 165 | reqVO.setName("灿灿姐的杂货铺"); |
| ... | ... | @@ -215,19 +211,19 @@ public class PayAppServiceTest extends BaseDbUnitTest { |
| 215 | 211 | |
| 216 | 212 | appMapper.insert(dbApp); |
| 217 | 213 | // 测试 name 不匹配 |
| 218 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setName("敏敏姐的杂货铺"))); | |
| 214 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setName("敏敏姐的杂货铺"))); | |
| 219 | 215 | // 测试 status 不匹配 |
| 220 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 216 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 221 | 217 | // 测试 remark 不匹配 |
| 222 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); | |
| 218 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); | |
| 223 | 219 | // 测试 payNotifyUrl 不匹配 |
| 224 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setPayNotifyUrl("xm.com"))); | |
| 220 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setPayNotifyUrl("xm.com"))); | |
| 225 | 221 | // 测试 refundNotifyUrl 不匹配 |
| 226 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); | |
| 222 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); | |
| 227 | 223 | // 测试 merchantId 不匹配 |
| 228 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setMerchantId(mismatchMerchantId))); | |
| 224 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setMerchantId(mismatchMerchantId))); | |
| 229 | 225 | // 测试 createTime 不匹配 |
| 230 | - appMapper.insert(ObjectUtils.clone(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); | |
| 226 | + appMapper.insert(cloneIgnoreId(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); | |
| 231 | 227 | // 准备参数 |
| 232 | 228 | PayAppExportReqVO reqVO = new PayAppExportReqVO(); |
| 233 | 229 | reqVO.setName("灿灿姐的杂货铺"); |
| ... | ... | @@ -246,4 +242,4 @@ public class PayAppServiceTest extends BaseDbUnitTest { |
| 246 | 242 | assertPojoEquals(dbApp, list.get(0)); |
| 247 | 243 | } |
| 248 | 244 | |
| 249 | -} | |
| 250 | 245 | \ No newline at end of file |
| 246 | +} | ... | ... |
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 |
| 10 | 10 | import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayChannelDO; |
| 11 | 11 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 13 | -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; | |
| 14 | 13 | import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig; |
| 15 | 14 | import cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXPayClientConfig; |
| 16 | 15 | import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; |
| ... | ... | @@ -23,6 +22,7 @@ import java.util.List; |
| 23 | 22 | |
| 24 | 23 | import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.CHANNEL_NOT_EXISTS; |
| 25 | 24 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; |
| 25 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 26 | 26 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 27 | 27 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; |
| 28 | 28 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; |
| ... | ... | @@ -222,37 +222,37 @@ public class PayChannelServiceTest extends BaseDbUnitTest { |
| 222 | 222 | // 执行拷贝的时候会出现异常,所以在插入后要重置为null 后续在写入新的 |
| 223 | 223 | dbChannel.setConfig(null); |
| 224 | 224 | // 测试 code 不匹配 |
| 225 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 225 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 226 | 226 | o.setConfig(payClientConfig); |
| 227 | 227 | o.setCode(PayChannelEnum.WX_PUB.getCode()); |
| 228 | 228 | })); |
| 229 | 229 | // 测试 status 不匹配 |
| 230 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 230 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 231 | 231 | o.setConfig(payClientConfig); |
| 232 | 232 | o.setStatus(CommonStatusEnum.DISABLE.getStatus()); |
| 233 | 233 | })); |
| 234 | 234 | // 测试 remark 不匹配 |
| 235 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o ->{ | |
| 235 | + channelMapper.insert(cloneIgnoreId(dbChannel, o ->{ | |
| 236 | 236 | o.setConfig(payClientConfig); |
| 237 | 237 | o.setRemark("敏敏子的渠道"); |
| 238 | 238 | })); |
| 239 | 239 | // 测试 feeRate 不匹配 |
| 240 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 240 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 241 | 241 | o.setConfig(payClientConfig); |
| 242 | 242 | o.setFeeRate(1.23); |
| 243 | 243 | })); |
| 244 | 244 | // 测试 merchantId 不匹配 |
| 245 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 245 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 246 | 246 | o.setConfig(payClientConfig); |
| 247 | 247 | o.setMerchantId(2L); |
| 248 | 248 | })); |
| 249 | 249 | // 测试 appId 不匹配 |
| 250 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 250 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 251 | 251 | o.setConfig(payClientConfig); |
| 252 | 252 | o.setAppId(2L); |
| 253 | 253 | })); |
| 254 | 254 | // 测试 createTime 不匹配 |
| 255 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 255 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 256 | 256 | o.setConfig(payClientConfig); |
| 257 | 257 | o.setCreateTime(buildTime(2021, 10, 20)); |
| 258 | 258 | })); |
| ... | ... | @@ -296,37 +296,37 @@ public class PayChannelServiceTest extends BaseDbUnitTest { |
| 296 | 296 | // 执行拷贝的时候会出现异常,所以在插入后要重置为null 后续在写入新的 |
| 297 | 297 | dbChannel.setConfig(null); |
| 298 | 298 | // 测试 code 不匹配 |
| 299 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 299 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 300 | 300 | o.setConfig(payClientConfig); |
| 301 | 301 | o.setCode(PayChannelEnum.WX_PUB.getCode()); |
| 302 | 302 | })); |
| 303 | 303 | // 测试 status 不匹配 |
| 304 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 304 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 305 | 305 | o.setConfig(payClientConfig); |
| 306 | 306 | o.setStatus(CommonStatusEnum.DISABLE.getStatus()); |
| 307 | 307 | })); |
| 308 | 308 | // 测试 remark 不匹配 |
| 309 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o ->{ | |
| 309 | + channelMapper.insert(cloneIgnoreId(dbChannel, o ->{ | |
| 310 | 310 | o.setConfig(payClientConfig); |
| 311 | 311 | o.setRemark("敏敏子的渠道"); |
| 312 | 312 | })); |
| 313 | 313 | // 测试 feeRate 不匹配 |
| 314 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 314 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 315 | 315 | o.setConfig(payClientConfig); |
| 316 | 316 | o.setFeeRate(1.23); |
| 317 | 317 | })); |
| 318 | 318 | // 测试 merchantId 不匹配 |
| 319 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 319 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 320 | 320 | o.setConfig(payClientConfig); |
| 321 | 321 | o.setMerchantId(2L); |
| 322 | 322 | })); |
| 323 | 323 | // 测试 appId 不匹配 |
| 324 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 324 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 325 | 325 | o.setConfig(payClientConfig); |
| 326 | 326 | o.setAppId(2L); |
| 327 | 327 | })); |
| 328 | 328 | // 测试 createTime 不匹配 |
| 329 | - channelMapper.insert(ObjectUtils.clone(dbChannel, o -> { | |
| 329 | + channelMapper.insert(cloneIgnoreId(dbChannel, o -> { | |
| 330 | 330 | o.setConfig(payClientConfig); |
| 331 | 331 | o.setCreateTime(buildTime(2021, 10, 20)); |
| 332 | 332 | })); | ... | ... |
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 |
| 11 | 11 | import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayMerchantDO; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 13 | 13 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 14 | -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; | |
| 15 | 14 | import org.junit.jupiter.api.Test; |
| 16 | 15 | import org.springframework.context.annotation.Import; |
| 17 | 16 | |
| ... | ... | @@ -19,10 +18,12 @@ import javax.annotation.Resource; |
| 19 | 18 | import java.util.List; |
| 20 | 19 | |
| 21 | 20 | import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.PAY_MERCHANT_NOT_EXISTS; |
| 21 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 22 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 22 | 23 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 23 | 24 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; |
| 24 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 25 | -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 25 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 26 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 26 | 27 | import static org.junit.jupiter.api.Assertions.*; |
| 27 | 28 | |
| 28 | 29 | /** |
| ... | ... | @@ -119,17 +120,17 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { |
| 119 | 120 | }); |
| 120 | 121 | merchantMapper.insert(dbMerchant); |
| 121 | 122 | // 测试 no 不匹配 |
| 122 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setNo("M200000"))); | |
| 123 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setNo("M200000"))); | |
| 123 | 124 | // 测试 name 不匹配 |
| 124 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setName("斌哥的杂货铺"))); | |
| 125 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setName("斌哥的杂货铺"))); | |
| 125 | 126 | // 测试 shortName 不匹配 |
| 126 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setShortName("斌斌子"))); | |
| 127 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setShortName("斌斌子"))); | |
| 127 | 128 | // 测试 status 不匹配 |
| 128 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 129 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 129 | 130 | // 测试 remark 不匹配 |
| 130 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); | |
| 131 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); | |
| 131 | 132 | // 测试 createTime 不匹配 |
| 132 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); | |
| 133 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); | |
| 133 | 134 | // 准备参数 |
| 134 | 135 | PayMerchantPageReqVO reqVO = new PayMerchantPageReqVO(); |
| 135 | 136 | reqVO.setNo("M1008611"); |
| ... | ... | @@ -161,17 +162,17 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { |
| 161 | 162 | }); |
| 162 | 163 | merchantMapper.insert(dbMerchant); |
| 163 | 164 | // 测试 no 不匹配 |
| 164 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setNo("M200000"))); | |
| 165 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setNo("M200000"))); | |
| 165 | 166 | // 测试 name 不匹配 |
| 166 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setName("斌哥的杂货铺"))); | |
| 167 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setName("斌哥的杂货铺"))); | |
| 167 | 168 | // 测试 shortName 不匹配 |
| 168 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setShortName("斌斌子"))); | |
| 169 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setShortName("斌斌子"))); | |
| 169 | 170 | // 测试 status 不匹配 |
| 170 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 171 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 171 | 172 | // 测试 remark 不匹配 |
| 172 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); | |
| 173 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setRemark("斌哥的杂货铺"))); | |
| 173 | 174 | // 测试 createTime 不匹配 |
| 174 | - merchantMapper.insert(ObjectUtils.clone(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); | |
| 175 | + merchantMapper.insert(cloneIgnoreId(dbMerchant, o -> o.setCreateTime(buildTime(2022,12,4)))); | |
| 175 | 176 | // 准备参数 |
| 176 | 177 | PayMerchantExportReqVO reqVO = new PayMerchantExportReqVO(); |
| 177 | 178 | reqVO.setNo("M1008611"); | ... | ... |
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; |
| 13 | 13 | import cn.iocoder.yudao.coreservice.modules.pay.enums.order.PayRefundTypeEnum; |
| 14 | 14 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 15 | 15 | import cn.iocoder.yudao.framework.common.util.date.DateUtils; |
| 16 | -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; | |
| 17 | 16 | import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; |
| 18 | 17 | import org.junit.jupiter.api.Test; |
| 19 | 18 | import org.springframework.context.annotation.Import; |
| ... | ... | @@ -22,6 +21,7 @@ import javax.annotation.Resource; |
| 22 | 21 | import java.util.Date; |
| 23 | 22 | import java.util.List; |
| 24 | 23 | |
| 24 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 25 | 25 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 26 | 26 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; |
| 27 | 27 | import static org.junit.jupiter.api.Assertions.assertEquals; |
| ... | ... | @@ -80,23 +80,23 @@ public class PayOrderServiceTest extends BaseDbUnitTest { |
| 80 | 80 | }); |
| 81 | 81 | orderMapper.insert(dbOrder); |
| 82 | 82 | // 测试 merchantId 不匹配 |
| 83 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantId(2L))); | |
| 83 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantId(2L))); | |
| 84 | 84 | // 测试 appId 不匹配 |
| 85 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setAppId(2L))); | |
| 85 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setAppId(2L))); | |
| 86 | 86 | // 测试 channelId 不匹配 |
| 87 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelId(2L))); | |
| 87 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelId(2L))); | |
| 88 | 88 | // 测试 channelCode 不匹配 |
| 89 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); | |
| 89 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); | |
| 90 | 90 | // 测试 merchantOrderId 不匹配 |
| 91 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantOrderId(generateNo()))); | |
| 91 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantOrderId(generateNo()))); | |
| 92 | 92 | // 测试 notifyStatus 不匹配 |
| 93 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); | |
| 93 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); | |
| 94 | 94 | // 测试 status 不匹配 |
| 95 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); | |
| 95 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); | |
| 96 | 96 | // 测试 refundStatus 不匹配 |
| 97 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); | |
| 97 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); | |
| 98 | 98 | // 测试 createTime 不匹配 |
| 99 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, | |
| 99 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, | |
| 100 | 100 | 1)))); |
| 101 | 101 | // 准备参数 |
| 102 | 102 | PayOrderPageReqVO reqVO = new PayOrderPageReqVO(); |
| ... | ... | @@ -155,23 +155,23 @@ public class PayOrderServiceTest extends BaseDbUnitTest { |
| 155 | 155 | }); |
| 156 | 156 | orderMapper.insert(dbOrder); |
| 157 | 157 | // 测试 merchantId 不匹配 |
| 158 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantId(2L))); | |
| 158 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantId(2L))); | |
| 159 | 159 | // 测试 appId 不匹配 |
| 160 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setAppId(2L))); | |
| 160 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setAppId(2L))); | |
| 161 | 161 | // 测试 channelId 不匹配 |
| 162 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelId(2L))); | |
| 162 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelId(2L))); | |
| 163 | 163 | // 测试 channelCode 不匹配 |
| 164 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); | |
| 164 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setChannelCode(PayChannelEnum.ALIPAY_APP.getCode()))); | |
| 165 | 165 | // 测试 merchantOrderId 不匹配 |
| 166 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setMerchantOrderId(generateNo()))); | |
| 166 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setMerchantOrderId(generateNo()))); | |
| 167 | 167 | // 测试 notifyStatus 不匹配 |
| 168 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); | |
| 168 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setNotifyStatus(PayOrderNotifyStatusEnum.FAILURE.getStatus()))); | |
| 169 | 169 | // 测试 status 不匹配 |
| 170 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); | |
| 170 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setStatus(PayOrderStatusEnum.CLOSED.getStatus()))); | |
| 171 | 171 | // 测试 refundStatus 不匹配 |
| 172 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); | |
| 172 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setRefundStatus(PayRefundTypeEnum.ALL.getStatus()))); | |
| 173 | 173 | // 测试 createTime 不匹配 |
| 174 | - orderMapper.insert(ObjectUtils.clone(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, | |
| 174 | + orderMapper.insert(cloneIgnoreId(dbOrder, o -> o.setCreateTime(DateUtils.buildTime(2019, 1, 1, 10, 10, | |
| 175 | 175 | 1)))); |
| 176 | 176 | // 准备参数 |
| 177 | 177 | PayOrderExportReqVO reqVO = new PayOrderExportReqVO(); | ... | ... |
yudao-admin-ui/src/utils/dict.js
| ... | ... | @@ -32,7 +32,7 @@ export const DICT_TYPE = { |
| 32 | 32 | TOOL_CODEGEN_TEMPLATE_TYPE: 'tool_codegen_template_type', |
| 33 | 33 | |
| 34 | 34 | OA_LEAVE_STATUS: 'oa_leave_status', |
| 35 | - OA_LEAVE_TYPE: 'oa_leave_type' | |
| 35 | + OA_LEAVE_TYPE: 'oa_leave_type', | |
| 36 | 36 | |
| 37 | 37 | // 商户状态 |
| 38 | 38 | PAY_MERCHANT_STATUS: 'pay_merchant_status', | ... | ... |