wyq 6 months ago
parent aa8ab5eb2e
commit 664349439d
  1. 40
      crmeb-admin/src/main/java/com/zbkj/admin/config/SmsConfig.java
  2. 6
      crmeb-admin/src/main/resources/application-prod.yml
  3. 5
      crmeb-admin/src/main/resources/application.yml
  4. 6
      crmeb-service/src/main/java/com/zbkj/service/service/impl/OrderPayServiceImpl.java
  5. 2
      crmeb-service/src/main/java/com/zbkj/service/service/impl/SmsServiceImpl.java

@ -0,0 +1,40 @@
package com.zbkj.admin.config;
import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.teaopenapi.models.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author admin2
*/
@Configuration
public class SmsConfig {
@Value("${sms.appkey}")
private String accessKeyId ;
@Value("${sms.secret}")
private String accessKeySecret ;
private static final String ENDPOINT = "dysmsapi.aliyuncs.com";
@Bean
public Client smsClient() {
try {
Config config = new Config()
// 必填,您的 AccessKey ID
.setAccessKeyId(accessKeyId)
// 必填,您的 AccessKey Secret
.setAccessKeySecret(accessKeySecret);
// 访问的域名
config.endpoint = ENDPOINT;
return new Client(config);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

@ -169,4 +169,8 @@ mdb:
userClientId: fd9z85kk-8665-64d4-9986-228a2h59b113
userUrl: https://creditcardapp.bankcomm.com/oautht
goodUrl: https://shopmall.xsbuy.cn/pages/goods/goods_details/index?id=
sms:
appkey: LTAI5tJdJ474w6EzLS6dBaRd
secret: fd2qfdKUn0NJbe6lVEWA66sxVSWhqN
template-code: SMS_174435568
sign-name: 上海湘商

@ -190,3 +190,8 @@ mdb:
userClientId: fd9z85kk-8665-64d4-9986-228a2h59b113
userUrl: http://piap_oauth_web.ydhl-dev1.apps.paasdev.pccc.com
goodUrl: http://mallshop-test.xsbuy.cn:200/static/html/pc.html
sms:
appkey: LTAI5tJdJ474w6EzLS6dBaRd
secret: fd2qfdKUn0NJbe6lVEWA66sxVSWhqN
template-code: SMS_174435568
sign-name: 上海湘商

@ -739,6 +739,12 @@ public class OrderPayServiceImpl implements OrderPayService {
if (storeOrder.getPaid()) {
throw new CrmebException("订单已支付");
}
//支付前查看先订单之前是否有支付会自动更新订单表
weChatPayService.queryPayResult(storeOrder.getOrderId());
storeOrder = storeOrderService.getByOderId(orderPayRequest.getOrderNo());
if (storeOrder.getPaid()) {
throw new CrmebException("订单已支付");
}
User user = userService.getById(storeOrder.getUid());
if (ObjectUtil.isNull(user)) throw new CrmebException("用户不存在");

@ -63,7 +63,7 @@ public class SmsServiceImpl implements SmsService {
@Autowired
private SystemConfigService systemConfigService;
@Autowired
@Resource
private com.aliyun.dysmsapi20170525.Client smsClient;
@Autowired
private RestTemplateUtil restTemplateUtil;

Loading…
Cancel
Save