diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/vo/PayMerchantBaseVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/vo/PayMerchantBaseVO.java index 4d83ff232..8bc863792 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/vo/PayMerchantBaseVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/vo/PayMerchantBaseVO.java @@ -12,6 +12,7 @@ import javax.validation.constraints.NotNull; @Data public class PayMerchantBaseVO { + // TODO @aquan:no 应该不允许修改。啊哈哈,我的原型没画对 @ApiModelProperty(value = "商户号") private String no; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java index 12981677f..b329de2c5 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java @@ -9,7 +9,6 @@ import cn.iocoder.yudao.adminserver.modules.pay.convert.merchant.PayMerchantConv import cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.merchant.PayMerchantMapper; import cn.iocoder.yudao.adminserver.modules.pay.service.merchant.PayMerchantService; import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayMerchantDO; -import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import com.google.common.annotations.VisibleForTesting; import org.springframework.stereotype.Service; @@ -20,7 +19,7 @@ import java.time.LocalDateTime; import java.util.Collection; import java.util.List; -import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.*; +import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.MERCHANT_NOT_EXISTS; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; /** * 支付商户信息 Service 实现类 @@ -39,6 +38,7 @@ public class PayMerchantServiceImpl implements PayMerchantService { // 插入 PayMerchantDO merchant = PayMerchantConvert.INSTANCE.convert(createReqVO); // 根据 年月日时分秒毫秒 生成时间戳 + // TODO @aquan:生成 no 可以单独一个小方法 String merchantNo = "M" + DateUtil.format(LocalDateTime.now(),"yyyyMMddHHmmssSSS"); merchant.setNo(merchantNo); merchantMapper.insert(merchant); diff --git a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/merchant/service/PayMerchantServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/merchant/service/PayMerchantServiceTest.java index a93808921..f1f4626e1 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/merchant/service/PayMerchantServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/pay/merchant/service/PayMerchantServiceTest.java @@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.*; /** * {@link PayMerchantServiceImpl} 的单元测试类 * -* @author 芋艿 +* @author 芋艿 // TODO @aquan:修改成自己的。。。 */ @Import(PayMerchantServiceImpl.class) public class PayMerchantServiceTest extends BaseDbUnitTest { @@ -51,6 +51,7 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { assertNotNull(merchantId); // 校验记录的属性是否正确 PayMerchantDO merchant = merchantMapper.selectById(merchantId); + // TODO @aquan:需要判断 no 非空 assertPojoEquals(reqVO, merchant,"no"); } diff --git a/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/pay/dal/dataobject/merchant/PayMerchantDO.java b/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/pay/dal/dataobject/merchant/PayMerchantDO.java index b8edba7e8..3c32cf86d 100644 --- a/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/pay/dal/dataobject/merchant/PayMerchantDO.java +++ b/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/pay/dal/dataobject/merchant/PayMerchantDO.java @@ -33,7 +33,7 @@ public class PayMerchantDO extends BaseDO { * 例如说,M233666999 * 只有新增时插入,不允许修改 */ - @TableField(fill = FieldFill.INSERT) + @TableField(fill = FieldFill.INSERT) // TODO @aquan:Service 逻辑里设置,所以不用这个注解哈 private String no; /** * 商户全称 diff --git a/yudao-core-service/src/test-integration/java/cn/iocoder/yudao/coreservice/modules/pay/dal/mysql/merchant/PayChannelCoreMapperTest.java b/yudao-core-service/src/test-integration/java/cn/iocoder/yudao/coreservice/modules/pay/dal/mysql/merchant/PayChannelCoreMapperTest.java index e7a217f59..18445a4ec 100644 --- a/yudao-core-service/src/test-integration/java/cn/iocoder/yudao/coreservice/modules/pay/dal/mysql/merchant/PayChannelCoreMapperTest.java +++ b/yudao-core-service/src/test-integration/java/cn/iocoder/yudao/coreservice/modules/pay/dal/mysql/merchant/PayChannelCoreMapperTest.java @@ -21,10 +21,10 @@ public class PayChannelCoreMapperTest extends BaseDbAndRedisIntegrationTest { private PayChannelCoreMapper payChannelCoreMapper; /** - * 插入初始配置 + * 插入 {@link PayChannelEnum#WX_PUB} 初始配置 */ @Test - public void testInsert() throws FileNotFoundException { + public void testInsertWxPub() throws FileNotFoundException { PayChannelDO payChannelDO = new PayChannelDO(); payChannelDO.setCode(PayChannelEnum.WX_PUB.getCode()); payChannelDO.setStatus(CommonStatusEnum.ENABLE.getStatus()); @@ -45,11 +45,12 @@ public class PayChannelCoreMapperTest extends BaseDbAndRedisIntegrationTest { payChannelCoreMapper.insert(payChannelDO); } + // TODO @ouyang:Zfb 改成 AlipayQr /** - * 插入支付宝 初始配置 + * 插入 {@link PayChannelEnum#ALIPAY_QR} 初始配置 */ @Test - public void testInsertZfb() throws FileNotFoundException { + public void testInsertZfb() { PayChannelDO payChannelDO = new PayChannelDO(); payChannelDO.setCode(PayChannelEnum.ALIPAY_QR.getCode()); payChannelDO.setStatus(CommonStatusEnum.ENABLE.getStatus()); diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayNotifyDataDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayNotifyDataDTO.java index 64ae920ad..344e98810 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayNotifyDataDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayNotifyDataDTO.java @@ -6,7 +6,7 @@ import lombok.ToString; import java.util.Map; - +// TODO @jason:注释要写下哈。字段不要使用 // 注释,非标准 @Data @ToString @Builder diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayOrderNotifyRespDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayOrderNotifyRespDTO.java index 54ff16608..a5c24c24e 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayOrderNotifyRespDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayOrderNotifyRespDTO.java @@ -42,7 +42,6 @@ public class PayOrderNotifyRespDTO { */ private String data; - /** * TODO @jason 结合其他的渠道定义成枚举, * alipay diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/pay/controller/order/PayOrderController.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/pay/controller/order/PayOrderController.java index 169d60a35..d4c31395e 100644 --- a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/pay/controller/order/PayOrderController.java +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/pay/controller/order/PayOrderController.java @@ -72,15 +72,16 @@ public class PayOrderController { return "success"; } - @RequestMapping("/notify/test") - @ApiOperation("通知的测试接口") - public String notifyTest() { -// System.out.println(data); - return "success"; + @GetMapping(value = "/return/alipay-qr/{channelId}") + @ApiOperation("支付宝 wap 页面回跳") + public String returnAliPayQrPayOrder(@PathVariable("channelId") Long channelId){ + //TODO @jason 校验 是否支付宝调用。 支付宝publickey 可以根据 appId 跳转不同的页面 + System.out.println("支付成功"); + return "支付成功"; } @PostMapping(value = "/notify/alipay-wap/{channelId}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) - @ApiOperation("支付宝wap页面回调") + @ApiOperation("支付宝 wap 页面回调") public String notifyAliPayWapPayOrder(@PathVariable("channelId") Long channelId, @RequestParam Map params, @RequestBody String originData) throws Exception { @@ -89,25 +90,23 @@ public class PayOrderController { return "success"; } - /** * https://opendocs.alipay.com/open/203/105285#%E5%89%8D%E5%8F%B0%E5%9B%9E%E8%B7%B3%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E * @param channelId 渠道id * @return 返回跳转页面 */ @GetMapping(value = "/return/alipay-wap/{channelId}") - @ApiOperation("支付宝wap页面回跳") + @ApiOperation("支付宝 wap 页面回跳") public String returnAliPayWapPayOrder(@PathVariable("channelId") Long channelId){ //TODO 校验 是否支付宝调用。 可以根据 appId 跳转不同的页面 return "支付成功"; } - - @GetMapping(value = "/return/alipay-qr/{channelId}") - @ApiOperation("支付宝wap页面回跳") - public String returnAliPayQrPayOrder(@PathVariable("channelId") Long channelId){ - //TODO @jason 校验 是否支付宝调用。 支付宝publickey 可以根据 appId 跳转不同的页面 - System.out.println("支付成功"); - return "支付成功"; + @RequestMapping("/notify/test") + @ApiOperation("通知的测试接口") + public String notifyTest() { +// System.out.println(data); + return "success"; } + }