Commit 3d296470e90915ebe423ce3eaa8d5bf4e58c510f
1 parent
1dc65458
Exists in
dev
update
Showing
5 changed files
with
45 additions
and
14 deletions
Show diff stats
backend/assembly/src/main/resources/application-dev.yml
... | ... | @@ -5,18 +5,28 @@ spring: |
5 | 5 | dynamic: |
6 | 6 | datasource: |
7 | 7 | master: |
8 | - #开发环境配置 | |
8 | +# #开发环境配置 | |
9 | 9 | username: root |
10 | 10 | password: Peony2021 |
11 | 11 | driver-class-name: com.mysql.cj.jdbc.Driver |
12 | 12 | url: jdbc:mysql://123.60.140.65:10002/lpg_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true |
13 | 13 | |
14 | - #生产环境配置 | |
14 | +# 生产环境配置 | |
15 | 15 | # username: root |
16 | 16 | # password: Carbon@2024 |
17 | 17 | # driver-class-name: com.mysql.cj.jdbc.Driver |
18 | 18 | # url: jdbc:mysql://localhost:13307/lpg?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true |
19 | 19 | |
20 | +# 生产环境配置2 | |
21 | +# username: root | |
22 | +# password: Carbon@2024 | |
23 | +# driver-class-name: com.mysql.cj.jdbc.Driver | |
24 | +# url: jdbc:mysql://localhost:13307/lpg_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true | |
25 | + | |
26 | + | |
27 | + | |
28 | + | |
29 | + | |
20 | 30 | |
21 | 31 | druid: |
22 | 32 | filters: stat |
... | ... | @@ -201,5 +211,9 @@ jdbcParam: |
201 | 211 | jdbcurl: jdbc:mysql://123.60.140.65:10002/lpg_dev |
202 | 212 | username: root |
203 | 213 | password: Peony2021 |
214 | + | |
204 | 215 | ygxx: |
205 | - ewm: /pages/scanCodeUserInfo/index/ | |
206 | 216 | \ No newline at end of file |
217 | + ewm: /pages/scanCodeUserInfo/index/ | |
218 | + | |
219 | +payment: | |
220 | + hostUrl: https://lpg.ip-server.cn/lpg_test/api | ... | ... |
backend/auth-server/src/main/java/com/hotent/auth/server/service/impl/AuthenticationServiceImpl.java
... | ... | @@ -412,7 +412,8 @@ public class AuthenticationServiceImpl implements AuthenticationService { |
412 | 412 | //处理单用户登录 |
413 | 413 | handleSingleLogin(isMobile, tenantId, account, token); |
414 | 414 | // Return the token |
415 | - return ResponseEntity.ok(new JwtAuthenticationResponse(token, userName, account, userId)); | |
415 | + JwtAuthenticationResponse jwtAuthenticationResponse = new JwtAuthenticationResponse(token, userName, account, userId,openid); | |
416 | + return ResponseEntity.ok(jwtAuthenticationResponse); | |
416 | 417 | }else { |
417 | 418 | if(StringUtil.isNotEmpty(openid)) { |
418 | 419 | return ResponseEntity.ok(new JwtAuthenticationResponse(openid)); | ... | ... |
backend/base/src/main/java/com/hotent/base/jwt/JwtAuthenticationResponse.java
... | ... | @@ -15,9 +15,18 @@ public class JwtAuthenticationResponse implements Serializable { |
15 | 15 | private String openid; |
16 | 16 | private Long expiration; |
17 | 17 | private boolean loginStatus = true; |
18 | - | |
18 | + | |
19 | 19 | private Map<String,Object> userAttrs = new HashMap<String, Object>(); |
20 | 20 | |
21 | + public JwtAuthenticationResponse(String token, String username,String account,String userId,String openid) { | |
22 | + this.token = token; | |
23 | + this.username = username; | |
24 | + this.account = account; | |
25 | + this.userId = userId; | |
26 | + this.openid = openid; | |
27 | + } | |
28 | + | |
29 | + | |
21 | 30 | public JwtAuthenticationResponse(String token, String username,String account,String userId) { |
22 | 31 | this.token = token; |
23 | 32 | this.username = username; |
... | ... | @@ -56,7 +65,7 @@ public class JwtAuthenticationResponse implements Serializable { |
56 | 65 | public String getToken() { |
57 | 66 | return this.token; |
58 | 67 | } |
59 | - | |
68 | + | |
60 | 69 | public String getUsername() { |
61 | 70 | return this.username; |
62 | 71 | } |
... | ... | @@ -84,5 +93,5 @@ public class JwtAuthenticationResponse implements Serializable { |
84 | 93 | public void setUserAttrs(Map<String,Object> userAttrs) { |
85 | 94 | this.userAttrs = userAttrs; |
86 | 95 | } |
87 | - | |
96 | + | |
88 | 97 | } | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/manager/impl/WxPayManagerImpl.java
... | ... | @@ -26,12 +26,14 @@ import com.hotent.lpg.user.util.LocalDateTimeUtils; |
26 | 26 | import com.hotent.lpg.user.util.WxPayConfiguration; |
27 | 27 | import lombok.AllArgsConstructor; |
28 | 28 | import lombok.extern.slf4j.Slf4j; |
29 | +import org.springframework.beans.factory.annotation.Value; | |
29 | 30 | import org.springframework.stereotype.Service; |
30 | 31 | import org.w3c.dom.Document; |
31 | 32 | import org.w3c.dom.Element; |
32 | 33 | import org.w3c.dom.Node; |
33 | 34 | import org.xml.sax.InputSource; |
34 | 35 | |
36 | +import javax.annotation.Resource; | |
35 | 37 | import javax.xml.bind.JAXBContext; |
36 | 38 | import javax.xml.parsers.DocumentBuilder; |
37 | 39 | import javax.xml.parsers.DocumentBuilderFactory; |
... | ... | @@ -49,12 +51,18 @@ import java.time.LocalDateTime; |
49 | 51 | import java.util.HashMap; |
50 | 52 | |
51 | 53 | @Service |
52 | -@AllArgsConstructor | |
53 | 54 | @Slf4j |
54 | 55 | public class WxPayManagerImpl implements WxPayManager { |
55 | 56 | |
56 | - private final DdDao ddDao; | |
57 | - private final CzzfpzDao czzfpzDao; | |
57 | + | |
58 | + @Value("${payment.hostUrl}") | |
59 | + private String hostUrl; | |
60 | + | |
61 | + @Resource | |
62 | + private DdDao ddDao; | |
63 | + | |
64 | + @Resource | |
65 | + private CzzfpzDao czzfpzDao; | |
58 | 66 | |
59 | 67 | /** |
60 | 68 | * 发起退款请求 |
... | ... | @@ -91,7 +99,7 @@ public class WxPayManagerImpl implements WxPayManager { |
91 | 99 | refundRequest.setOutRefundNo(RandomUtil.randomString(32)); // 退款单号 |
92 | 100 | refundRequest.setTotalFee(wDd.getFDdje().multiply(new BigDecimal(100)).intValue()); // 订单总金额 |
93 | 101 | refundRequest.setRefundFee(wDd.getFDdje().multiply(new BigDecimal(100)).intValue()); // 退款金额 |
94 | - refundRequest.setNotifyUrl(WxPayConfiguration.hostUrl + "/user/wxPay/handleRefundSuccessCallback"); | |
102 | + refundRequest.setNotifyUrl(hostUrl + "/user/wxPay/handleRefundSuccessCallback"); | |
95 | 103 | // 发起退款请求 |
96 | 104 | Object payment = wxPayService.refund(refundRequest); |
97 | 105 | // 返回结果 |
... | ... | @@ -236,7 +244,7 @@ public class WxPayManagerImpl implements WxPayManager { |
236 | 244 | scene_info.put("id", "LPG"); |
237 | 245 | scene_info.put("name", "燃气"); |
238 | 246 | wxPayUnifiedOrderRequest.setSceneInfo(scene_info.toString()); |
239 | - wxPayUnifiedOrderRequest.setNotifyUrl(WxPayConfiguration.hostUrl + "/user/wxPay/handlePaySuccessCallback"); // 支付回调地址,开放不用登录 | |
247 | + wxPayUnifiedOrderRequest.setNotifyUrl(hostUrl + "/user/wxPay/handlePaySuccessCallback"); // 支付回调地址,开放不用登录 | |
240 | 248 | wxPayUnifiedOrderRequest.setSpbillCreateIp("127.0.0.1"); |
241 | 249 | // trade_type=APP时 移动应用内的支付场景 |
242 | 250 | if ("APP".equals(wxPayUnifiedOrderRequest.getTradeType())) { | ... | ... |
backend/lpg-user/src/main/java/com/hotent/lpg/user/util/WxPayConfiguration.java
... | ... | @@ -4,11 +4,10 @@ import com.github.binarywang.wxpay.config.WxPayConfig; |
4 | 4 | import com.github.binarywang.wxpay.service.WxPayService; |
5 | 5 | import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; |
6 | 6 | import com.hotent.lpg.common.model.WCzzfpz; |
7 | +import org.springframework.beans.factory.annotation.Value; | |
7 | 8 | |
8 | 9 | public class WxPayConfiguration { |
9 | 10 | |
10 | - | |
11 | - public static final String hostUrl = "https://lpg.ip-server.cn/api"; | |
12 | 11 | public static WxPayService getPayService(WCzzfpz wCzzfpz) { |
13 | 12 | WxPayConfig wxPayConfig = new WxPayConfig(); |
14 | 13 | wxPayConfig.setAppId(wCzzfpz.getFAppid()); // appId(应用id)(微信支付商户平台获取) | ... | ... |