server/.gitignore
@@ -24,3 +24,4 @@ # Package Files # *.jar *.war /CLAUDE.md server/admin/pom.xml
@@ -52,7 +52,7 @@ <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <mainClass>com.doumee.JKAdminApplication</mainClass> <mainClass>com.doumee.GTAdminApplication</mainClass> <layout>ZIP</layout> </configuration> <executions> server/admin/src/main/java/com/doumee/GTAdminApplication.java
ÎļþÃû´Ó server/admin/src/main/java/com/doumee/JKAdminApplication.java ÐÞ¸Ä @@ -18,14 +18,14 @@ @SpringBootApplication @MapperScan("com.doumee.dao") @EnableAsync public class JKAdminApplication extends SpringBootServletInitializer { public class GTAdminApplication extends SpringBootServletInitializer { public static void main(String[] args) { ApplicationContext context = SpringApplication.run(JKAdminApplication.class); ApplicationContext context = SpringApplication.run(GTAdminApplication.class); context.getEnvironment(); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(JKAdminApplication.class) ; return builder.sources(GTAdminApplication.class) ; } } server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java
@@ -53,248 +53,4 @@ @Autowired private WithdrawalOrdersService withdrawalOrdersService; /** * ã微信æ¯ä»ã弿¥éç¥ * * @return */ @PostMapping("/web/wxPayNotify") public ApiResponse wxPay_notify(HttpServletRequest request) { log.error("微信æ¯ä»åè°ç»æå¼å§===========" ); try { ServletInputStream inputStream = request.getInputStream(); StringBuffer stringBuffer = new StringBuffer(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String s; //读ååè°è¯·æ±ä½ while ((s = bufferedReader.readLine()) != null) { stringBuffer.append(s); } String body = stringBuffer.toString(); String timestamp = request.getHeader("Wechatpay-Timestamp"); String nonce = request.getHeader("Wechatpay-Nonce"); String signType = request.getHeader("Wechatpay-Signature-Type"); String serialNo = request.getHeader("wechatpay-Serial"); String signature = request.getHeader("Wechatpay-Signature"); RequestParam requestParam = new RequestParam.Builder() .serialNumber(serialNo) .nonce(nonce) .signType(signType) .signature(signature) .timestamp(String.valueOf(timestamp)) .body(body) .build(); NotificationConfig config = new RSAPublicKeyConfig.Builder() .merchantId(WxMiniConfig.wxProperties.getMchId()) .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) .publicKeyFromPath(WxMiniConfig.wxProperties.getPubKeyPath()) .publicKeyId(WxMiniConfig.wxProperties.getPayPublicKeyId()) .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer()) .apiV3Key(WxMiniConfig.wxProperties.getApiV3Key()) .build(); NotificationParser parser = new NotificationParser(config); Transaction result = parser.parse(requestParam, Transaction.class); log.error("æ¯ä»åè°ä¿¡æ¯ï¼{}"+ JSONObject.toJSONString(result)); //èªå®ä¹è®¢åå· String outTradeNo = result.getOutTradeNo(); //微信订åå· String paymentNo = result.getTransactionId(); if ("SUCCESS".equals(result.getTradeState().name())) { // æ¯ä»æåge switch (result.getAttach()) { //æ¯ä»è®¢ååè° case "createOrder": { ordersService.payNotify(outTradeNo,paymentNo); break; } } } else { // æ¯ä»å¤±è´¥ switch (result.getAttach()) { case "createOrder": { break; } } } log.error("微信æ¯ä»åè°ç»æç»æ===========" ); return ApiResponse.success("å¤çæå!"); } catch (Exception e) { e.printStackTrace(); log.error("微信åè°ç»æå¼å¸¸,å¼å¸¸åå {}", e.getLocalizedMessage()); return ApiResponse.failed(""); } } @PostMapping("/web/wxRefundNotify") public ApiResponse wxRefundNotify(HttpServletRequest request) { log.error("å¾®ä¿¡éæ¬¾åè°ç»æå¼å§===========" ); try { DefaultSecurityManager securityManager = new DefaultSecurityManager(); SecurityUtils.setSecurityManager(securityManager); ServletInputStream inputStream = request.getInputStream(); StringBuffer stringBuffer = new StringBuffer(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String s; //读ååè°è¯·æ±ä½ while ((s = bufferedReader.readLine()) != null) { stringBuffer.append(s); } String body = stringBuffer.toString(); String timestamp = request.getHeader("Wechatpay-Timestamp"); String nonce = request.getHeader("Wechatpay-Nonce"); String signType = request.getHeader("Wechatpay-Signature-Type"); String serialNo = request.getHeader("wechatpay-Serial"); String signature = request.getHeader("Wechatpay-Signature"); RequestParam requestParam = new RequestParam.Builder() .serialNumber(serialNo) .nonce(nonce) .signType(signType) .signature(signature) .timestamp(String.valueOf(timestamp)) .body(body) .build(); NotificationConfig config = /*new RSAAutoCertificateConfig.Builder() .merchantId(WxMiniConfig.wxProperties.getMchId()) .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer()) .apiV3Key(WxMiniConfig.wxProperties.getApiV3Key()) .build();*/ new RSAPublicKeyConfig.Builder() .merchantId(WxMiniConfig.wxProperties.getMchId()) .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) .publicKeyFromPath(WxMiniConfig.wxProperties.getPubKeyPath()) .publicKeyId(WxMiniConfig.wxProperties.getPayPublicKeyId()) .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer()) .apiV3Key(WxMiniConfig.wxProperties.getApiV3Key()) .build(); NotificationParser parser = new NotificationParser(config); RefundNotification result = parser.parse(requestParam, RefundNotification.class); // if ("SUCCESS".equals(result.getRefundStatus().name())) { // æ¯ä»æåge ordersService.refundCallback(result); // } return ApiResponse.success("å¤çæå"); } catch (Exception e) { e.printStackTrace(); log.error("微信åè°ç»æå¼å¸¸,å¼å¸¸åå {}", e.getLocalizedMessage()); return ApiResponse.failed(""); } } /** * å¾®ä¿¡åæ·é¶çº¿è½¬è´¦ - åè°éç¥ * @Context注解 æHTTP请æ±ä¸ä¸æå¯¹è±¡æ³¨å ¥è¿æ¥ï¼HttpServletRequestãHttpServletResponseãUriInfo ç * @return */ @PostMapping(value = "/web/wechat/transferNotify") public ApiResponse transferNotify( HttpServletRequest request) { Map<String,String> errMap = new HashMap<>(); try { log.error("å¾®ä¿¡åæ·é¶çº¿è½¬è´¦ - åè°éç¥ /wxpay/callback"); Config config = new RSAPublicKeyConfig.Builder() .merchantId(WxMiniConfig.wxProperties.getSubMchId()) //微信æ¯ä»çåæ·å· .privateKeyFromPath(WxMiniConfig.wxProperties.getWechatPrivateKeyPath()) // åæ·APIè¯ä¹¦ç§é¥çåæ¾è·¯å¾ .publicKeyFromPath(WxMiniConfig.wxProperties.getWechatPubKeyPath()) //微信æ¯ä»å ¬é¥çåæ¾è·¯å¾ .publicKeyId(WxMiniConfig.wxProperties.getWechatPayPublicKeyId()) //微信æ¯ä»å ¬é¥ID .merchantSerialNumber(WxMiniConfig.wxProperties.getWechatSerialNumer()) //åæ·APIè¯ä¹¦åºåå· .apiV3Key(WxMiniConfig.wxProperties.getWechatApiV3Key()) //APIv3å¯é¥ .build(); TransferDetailEntityNew entity = wxSuccessCallback(request,config); log.error("transfer ok.{}",entity); //åè°æååå¤çèªå·±çä¸å¡ if(entity != null){ if((entity.getState().equals(Constants.SUCCESS) || entity.getState().equals(Constants.CANCELLED) || entity.getState().equals(Constants.FAIL)) && StringUtils.isNotBlank(entity.getOutBillNo())){ withdrawalOrdersService.transferSuccess(entity.getOutBillNo(),entity.getState().equals(Constants.SUCCESS)?true:false); } } return ApiResponse.success("å¤çæå"); } catch (Exception e) { log.error("å¾®ä¿¡åæ·é¶çº¿è½¬è´¦ - åè°éç¥ /wxpay/callbackï¼å¼å¸¸ï¼", e); errMap.put("code", "FAIL"); errMap.put("message", "æå¡å¨å é¨é误"); return ApiResponse.failed("å¤ç失败"); } } public TransferDetailEntityNew wxSuccessCallback(HttpServletRequest request,Config config) throws IOException { String requestBody = getBodyString(request, "UTF-8"); //è¯ä¹¦åºåå·ï¼å¾®ä¿¡å¹³å°ï¼ éªç¾çâ微信æ¯ä»å¹³å°è¯ä¹¦âæå¯¹åºçå¹³å°è¯ä¹¦åºåå· String wechatPaySerial = request.getHeader("Wechatpay-Serial"); //å¾®ä¿¡ä¼ éè¿æ¥çç¾å éªç¾çç¾åå¼ String wechatSignature = request.getHeader("Wechatpay-Signature"); //éªç¾çæ¶é´æ³ String wechatTimestamp = request.getHeader("Wechatpay-Timestamp"); //éªç¾çéæºå符串 String wechatpayNonce = request.getHeader("Wechatpay-Nonce"); // 1. æé RequestParam RequestParam requestParam = new RequestParam.Builder() .serialNumber(wechatPaySerial) .nonce(wechatpayNonce) .signature(wechatSignature) .timestamp(wechatTimestamp) .body(requestBody) .build(); // 2. æå»ºConfig RSAPublicKeyConfig // Config config = new RSAPublicKeyConfig.Builder() // .merchantId(WxMiniConfig.wxProperties.getMchId()) //微信æ¯ä»çåæ·å· // .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) // åæ·APIè¯ä¹¦ç§é¥çåæ¾è·¯å¾ // .publicKeyFromPath(WxMiniConfig.wxProperties.getWechatPubKeyPath()) //微信æ¯ä»å ¬é¥çåæ¾è·¯å¾ // .publicKeyId(WxMiniConfig.wxProperties.getWechatPayPublicKeyId()) //微信æ¯ä»å ¬é¥ID // .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer()) //åæ·APIè¯ä¹¦åºåå· // .apiV3Key("") //APIv3å¯é¥ // .build(); log.info("WxPayService.wxPaySuccessCallback request : wechatPaySerial is [{}] , wechatSignature is [{}] , wechatTimestamp is [{}] , wechatpayNonce is [{}] , requestBody is [{}]",wechatPaySerial,wechatSignature,wechatTimestamp,wechatpayNonce,requestBody); // 3. åå§å NotificationParser NotificationParser parser = new NotificationParser((NotificationConfig) config); try { TransferDetailEntityNew entity = parser.parse(requestParam, TransferDetailEntityNew.class); log.info("WxPayService.wxPaySuccessCallback responseBody: {}", entity != null ? JSON.toJSONString(entity) : null); return entity; } catch (Exception e) { log.error("Exception occurred while processing", e); throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ç³»ç»å é¨é误"); } } /** * è·åpost请æ±ä¸çBody * * @param request httpRequest * @return bodyå符串 */ public static String getBodyString(HttpServletRequest request, String charSet) throws IOException { StringBuilder sb = new StringBuilder(); InputStream inputStream = null; BufferedReader reader = null; try { inputStream = request.getInputStream(); //è¯»åæµå¹¶å°æµååºå»,é¿å æ°æ®æµä¸æ; reader = new BufferedReader(new InputStreamReader(inputStream, charSet)); String line; while ((line = reader.readLine()) != null) { sb.append(line); } } catch (IOException e) { log.error("è·årequestBodyå¼å¸¸", e); } finally { inputStream.close(); reader.close(); } return sb.toString(); } } server/services/src/main/java/com/doumee/config/wx/TransferToUser.java
ÎļþÒÑɾ³ý server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java
@@ -33,13 +33,11 @@ /********微信å°ç¨åºæå¡**********/ public static WxMaService wxMaService; /********微信å°ç¨åºæ¯ä»**********/ public static JsapiService wxPayService; // public static WxPayService wxPayV2Service; public static RefundService refundService; public static JsapiServiceExtension jsapiExtService; public static BillDownloadService billDownloadService; public static WxPayProperties wxProperties; public static TransferToUser transferToUser; public static WxPayService wxPayService; /********微信APPæ¯ä»**********/ public static WxPayService wxAppPayService; @Autowired private WxPayProperties wxPayProperties; @@ -51,23 +49,15 @@ void init() { this.load_WxMaService(); this.load_wxPayService(); // this.load_wxPayV2Service(); this.load_transferToUser(); this.wxProperties = wxPayProperties; // this.load_wxAppPayService(); } /** * åå§å微信å°ç¨åº */ public void load_WxMaService() { WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); if(wxPayProperties.getExistsSub() ==1){ //å¦ææ¯æå¡åæ¯ä»,åååæ·ä¿¡æ¯ config.setAppid(StringUtils.trimToNull(wxPayProperties.getSubAppId())); config.setSecret(StringUtils.trimToNull(wxPayProperties.getSubAppSecret())); }else { // config.setAppid(StringUtils.trimToNull(wxPayProperties.getAppId())); // config.setSecret(StringUtils.trimToNull(wxPayProperties.getAppSecret())); } config.setAppid(StringUtils.trimToNull(wxPayProperties.getAppId())); config.setSecret(StringUtils.trimToNull(wxPayProperties.getAppSecret())); config.setMsgDataFormat("JSON"); //config.setToken(""); //config.setAesKey(""); @@ -79,98 +69,37 @@ /** * åå§å微信å°ç¨åºæ¯ä» */ public void load_wxPayService() { try { Config config = new RSAPublicKeyConfig.Builder() .merchantId(wxPayProperties.getMchId()) .privateKeyFromPath(wxPayProperties.getPrivateKeyPath()) .publicKeyFromPath(wxPayProperties.getPubKeyPath()) .publicKeyId(wxPayProperties.getPayPublicKeyId()) .merchantSerialNumber(wxPayProperties.getSerialNumer()) .apiV3Key(wxPayProperties.getApiV3Key()) .build(); // Config config = // new RSAAutoCertificateConfig.Builder() // .merchantId(wxPayProperties.getMchId()) // .privateKeyFromPath(wxPayProperties.getPrivateKeyPath()) //// .publicKeyFromPath(wxPayProperties.getPubKeyPath()) //// .publicKeyId("PUB_KEY_ID_0117000719222024112700219100000508") // .merchantSerialNumber(wxPayProperties.getSerialNumer()) // .apiV3Key(wxPayProperties.getApiV3Key()) // .build(); // this.wxPayService = new JsapiService.Builder().config(config).build(); this.jsapiExtService = new JsapiServiceExtension.Builder().config(config).build(); this.refundService = new RefundService.Builder().config(config).build(); this.billDownloadService = new BillDownloadService.Builder().config(config).build(); }catch (Exception e){ e.printStackTrace(); } public void load_wxPayService() { WxPayConfig payConfig = new WxPayConfig(); payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); payConfig.setSignType(WxPayConstants.SignType.MD5); payConfig.setAppId(StringUtils.trimToNull(wxPayProperties.getAppId())); payConfig.setMchId(StringUtils.trimToNull(wxPayProperties.getMchId())); payConfig.setMchKey(StringUtils.trimToNull(wxPayProperties.getMchKey())); payConfig.setKeyPath(StringUtils.trimToNull(wxPayProperties.getKeyPath())); payConfig.setNotifyUrl(StringUtils.trimToNull(wxPayProperties.getNotifyUrl())); WxPayService wxPayService = new WxPayServiceImpl(); wxPayService.setConfig(payConfig); this.wxPayService = wxPayService; } /** * åå§å微信å°ç¨åºæ¯ä» */ // public void load_wxPayV2Service() // { // WxPayConfig payConfig = new WxPayConfig(); // payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); // payConfig.setSignType(WxPayConstants.SignType.MD5); // payConfig.setAppId(StringUtils.trimToNull(wxPayProperties.getAppId())); // payConfig.setSubAppId(StringUtils.trimToNull(wxPayProperties.getSubAppId())); // payConfig.setMchId(StringUtils.trimToNull(wxPayProperties.getMchId())); // payConfig.setSubMchId(StringUtils.trimToNull(wxPayProperties.getSubMchId())); // payConfig.setMchKey(StringUtils.trimToNull(wxPayProperties.getMchKey())); //// payConfig.setKeyPath(StringUtils.trimToNull(wxPayProperties.getKeyPath())); // payConfig.setNotifyUrl(StringUtils.trimToNull(wxPayProperties.getNotifyUrl())); // WxPayService wxPayService = new WxPayServiceImpl(); // wxPayService.setConfig(payConfig); // this.wxPayV2Service = wxPayService; // } /** * åå§å微信å°ç¨åºæ¯ä» */ // public void load_wxPayService() { // /** // * åå§åAppæ¯ä» // */ // public void load_wxAppPayService() { // WxPayConfig payConfig = new WxPayConfig(); // payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); // payConfig.setTradeType(WxPayConstants.TradeType.APP); // payConfig.setSignType(WxPayConstants.SignType.MD5); // payConfig.setAppId(StringUtils.trimToNull(sysDictService.getSysDictValue(SysDictEnum.WX_MINI_AppID.getCode()))); // payConfig.setAppId(""); // payConfig.setMchId(StringUtils.trimToNull(sysDictService.getSysDictValue(SysDictEnum.WX_MINI_MchId.getCode()))); // payConfig.setMchKey(StringUtils.trimToNull(sysDictService.getSysDictValue(SysDictEnum.WX_MINI_MchKey.getCode()))); // payConfig.setKeyPath(StringUtils.trimToNull(sysDictService.getSysDictValue(SysDictEnum.WX_MINI_KeyPath.getCode()))); // payConfig.setNotifyUrl(StringUtils.trimToNull(sysDictService.getSysDictValue(SysDictEnum.WX_MINI_NotifyUrl.getCode()))); // WxPayService wxPayService = new WxPayServiceImpl(); // wxPayService.setConfig(payConfig); // this.wxPayService = wxPayService; // this.wxAppPayService = wxPayService; // } //转账ä¸å¡ public void load_transferToUser() { TransferToUser transferToUser = new TransferToUser( StringUtils.trimToNull(wxPayProperties.getSubMchId()), //åæ·id StringUtils.trimToNull(wxPayProperties.getWechatSerialNumer()), //åæ·APIè¯ä¹¦åºåå·ï¼å¦ä½è·å请åè https://pay.weixin.qq.com/doc/v3/merchant/4013053053 StringUtils.trimToNull(wxPayProperties.getWechatPrivateKeyPath()), // åæ·APIè¯ä¹¦ç§é¥æä»¶è·¯å¾ï¼æ¬å°æä»¶è·¯å¾ StringUtils.trimToNull(wxPayProperties.getWechatPayPublicKeyId()), // 微信æ¯ä»å ¬é¥IDï¼å¦ä½è·å请åè https://pay.weixin.qq.com/doc/v3/merchant/4013038816 StringUtils.trimToNull(wxPayProperties.getWechatPubKeyPath()) // 微信æ¯ä»å ¬é¥æä»¶è·¯å¾ï¼æ¬å°æä»¶è·¯å¾ ); // TransferToUser client = new TransferToUser( // "1229817002", // åæ·å·ï¼æ¯ç±å¾®ä¿¡æ¯ä»ç³»ç»çæå¹¶åé ç»æ¯ä¸ªåæ·çå¯ä¸æ è¯ç¬¦ï¼åæ·å·è·åæ¹å¼åè https://pay.weixin.qq.com/doc/v3/merchant/4013070756 // "3FE90C2F3D40A56E1C51926F31B8A8D22426CCE0", // åæ·APIè¯ä¹¦åºåå·ï¼å¦ä½è·å请åè https://pay.weixin.qq.com/doc/v3/merchant/4013053053 // "d://wechatApiclient_key.pem", // åæ·APIè¯ä¹¦ç§é¥æä»¶è·¯å¾ï¼æ¬å°æä»¶è·¯å¾ // "PUB_KEY_ID_0112298170022025071700291836000600", // 微信æ¯ä»å ¬é¥IDï¼å¦ä½è·å请åè https://pay.weixin.qq.com/doc/v3/merchant/4013038816 // "d://pub_key.pem" // 微信æ¯ä»å ¬é¥æä»¶è·¯å¾ï¼æ¬å°æä»¶è·¯å¾ // ); this.transferToUser = transferToUser; } } server/services/src/main/java/com/doumee/config/wx/WxMiniUtilService.java
@@ -49,33 +49,34 @@ @Transactional(rollbackFor = {BusinessException.class,Exception.class}) public boolean wxRefund(WithdrawalOrders withdrawalOrders,Orders orders) { // åé鿬¾è¯·æ± withdrawalOrders.setCreateTime(new Date()); withdrawalOrdersMapper.insert(withdrawalOrders); CreateRequest request = new CreateRequest(); request.setOutTradeNo(orders.getOutTradeNo()); request.setOutRefundNo(withdrawalOrders.getId().toString()); request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId()); request.setNotifyUrl(WxMiniConfig.wxProperties.getRefundNotifyUrl()); AmountReq amountReq = new AmountReq(); amountReq.setTotal(1L);//withdrawalOrders.getAmount()); amountReq.setRefund(1L);//withdrawalOrders.getAmount()); amountReq.setCurrency("CNY"); request.setAmount(amountReq); try { log.error("=============="+JSONObject.toJSONString(request)); com.wechat.pay.java.service.refund.model.Refund response = WxMiniConfig.refundService.create(request); log.error("=============="+JSONObject.toJSONString(response)); if ("SUCCESS".equals(response.getStatus().name()) || "PROCESSING".equals(response.getStatus().name()) ) { return true; }else{ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼é款ç³è¯·å¤±è´¥å¦ï¼"); } }catch (Exception e){ e.printStackTrace(); throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼é款ç³è¯·å¤±è´¥ï¼"); } // // åé鿬¾è¯·æ± // withdrawalOrders.setCreateTime(new Date()); // withdrawalOrdersMapper.insert(withdrawalOrders); // CreateRequest request = new CreateRequest(); // request.setOutTradeNo(orders.getOutTradeNo()); // request.setOutRefundNo(withdrawalOrders.getId().toString()); // request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId()); // request.setNotifyUrl(WxMiniConfig.wxProperties.getRefundNotifyUrl()); // AmountReq amountReq = new AmountReq(); // amountReq.setTotal(1L);//withdrawalOrders.getAmount()); // amountReq.setRefund(1L);//withdrawalOrders.getAmount()); // amountReq.setCurrency("CNY"); // request.setAmount(amountReq); // try { // log.error("=============="+JSONObject.toJSONString(request)); // com.wechat.pay.java.service.refund.model.Refund response = WxMiniConfig.wxPayService.refund(request); // log.error("=============="+JSONObject.toJSONString(response)); // if ("SUCCESS".equals(response.getStatus().name()) // || "PROCESSING".equals(response.getStatus().name()) ) { // return true; // }else{ // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼é款ç³è¯·å¤±è´¥å¦ï¼"); // } // }catch (Exception e){ // e.printStackTrace(); // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼é款ç³è¯·å¤±è´¥ï¼"); // } return false; } server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java
@@ -15,11 +15,11 @@ @Data public class WxPayProperties { /** * AppID */ private String appId; private String apiV3Key; /** * AppSecret @@ -35,44 +35,15 @@ * æ¯ä»APIå¯é¥ */ private String mchKey; /** * æ¯ä»APIå¯é¥ */ // private String subMchKey; /** * æ¯ä»åè°å°å */ private String notifyUrl; /** * 鿬¾åè°å°å */ private String refundNotifyUrl; /** * æ¯ä»è¯ä¹¦(p12) */ private String keyPath; private String serialNumer; private int existsSub;// true private String subAppId;//wxcd2b89fd2ff065f8 private String subMchId;// 1229817002 private String subAppSecret;// 1229817002 private String typeId;// gybike private String privateKeyPath ; private String privateCertPath;// gybike private String pubKeyPath;// private String payPublicKeyId;// private String wechatSerialNumer; private String wechatPayPublicKeyId; // 微信æ¯ä»å ¬é¥ID private String wechatPubKeyPath; //微信æ¯ä»å ¬é¥æä»¶è·¯å¾ private String wechatPrivateKeyPath; private String wechatNotifyUrl; private String wechatApiV3Key; // private String wechatPlatformPubKeyPath; } server/services/src/main/java/com/doumee/core/constants/Constants.java
@@ -3,8 +3,13 @@ import com.doumee.dao.business.model.Orders; import lombok.AllArgsConstructor; import lombok.Getter; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.*; /** @@ -753,5 +758,44 @@ } public static String getIpAddr() { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String ipAddress = null; try { ipAddress = request.getHeader("x-forwarded-for"); if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("Proxy-Client-IP"); } if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("WL-Proxy-Client-IP"); } if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getRemoteAddr(); if (ipAddress.equals("127.0.0.1")) { // æ ¹æ®ç½å¡åæ¬æºé ç½®çIP InetAddress inet = null; try { inet = InetAddress.getLocalHost(); } catch (UnknownHostException e) { e.printStackTrace(); } ipAddress = inet.getHostAddress(); } } // 对äºéè¿å¤ä¸ªä»£ççæ åµï¼ç¬¬ä¸ä¸ªIP为客æ·ç«¯çå®IP,å¤ä¸ªIPæç §','åå² if (ipAddress != null && ipAddress.length() > 15) { // "***.***.***.***".length() // = 15 if (ipAddress.indexOf(",") > 0) { ipAddress = ipAddress.substring(0, ipAddress.indexOf(",")); } } } catch (Exception e) { ipAddress = "127.0.0.1"; } // ipAddress = this.getRequest().getRemoteAddr(); return ipAddress; } } server/services/src/main/java/com/doumee/dao/vo/PayResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,31 @@ package com.doumee.dao.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2023/3/23 9:50 */ @Data @ApiModel("æ¯ä»ç¸åºç±»") public class PayResponse implements Serializable { @ApiModelProperty(value = "æ¯ä»è®¢å主é®") private Integer orderId; @ApiModelProperty(value = "æ¯ä»ç±»åï¼0=ç°éæ¯ä»ï¼1=çº¯ç§¯åæ¯ä»") private Integer payType; @ApiModelProperty(value = "微信è°èµ·ä¸å¡") private Object response; @ApiModelProperty(value = "éå®ç¼å·",hidden = true) private String lockKey; } server/services/src/main/java/com/doumee/service/business/WithdrawalOrdersService.java
@@ -1,6 +1,5 @@ package com.doumee.service.business; import com.doumee.config.wx.TransferToUser; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.WithdrawalOrders; @@ -98,9 +97,6 @@ */ long count(WithdrawalOrders withdrawalOrders); TransferToUser.TransferToUserResponse applyWithdrawal(WithdrawalDTO withdrawalDTO); void cancelTransfer(TransferToUser.CancelTransferRequest request); void transferSuccess(String outBillNo,Boolean isSuccess); server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
@@ -19,12 +19,16 @@ import com.doumee.dao.business.model.*; import com.doumee.dao.dto.*; import com.doumee.dao.vo.OrderReleaseVO; import com.doumee.dao.vo.PayResponse; import com.doumee.service.business.AliSmsService; import com.doumee.service.business.OrdersService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.wechat.pay.java.service.partnerpayments.jsapi.model.Amount; import com.wechat.pay.java.service.partnerpayments.jsapi.model.Payer; @@ -44,10 +48,15 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -194,30 +203,32 @@ return orderReleaseVO; } private Object getWxPayResponse(Orders orders,String openid){ Object response = null; //è°èµ·æ¯ä» PrepayRequest request = new PrepayRequest(); request.setAttach("createOrder"); request.setDescription("è¿å¿«è®¢åæ¯ä»"); request.setSpMchid(WxMiniConfig.wxProperties.getMchId()); request.setSpAppid(WxMiniConfig.wxProperties.getAppId()); request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId()); request.setSubAppid(WxMiniConfig.wxProperties.getSubAppId()); private PayResponse getWxPayResponse(Orders orders,String openid){ try { Object response = null; //è°èµ·æ¯ä» WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest(); request.setAttach("createOrder"); request.setAttach("è®¢åæ¯ä»"); request.setOutTradeNo(orders.getOutTradeNo()); request.setTotalFee(BaseWxPayRequest.yuanToFen(orders.getPrice().toString())); Payer payer = new Payer(); payer.setSubOpenid(openid); request.setPayer(payer); request.setOutTradeNo(orders.getOutTradeNo()); request.setNotifyUrl(WxMiniConfig.wxProperties.getNotifyUrl());//è¿ä¸ªåè°urlå¿ é¡»æ¯httpså¼å¤´ç Amount amount = new Amount(); amount.setTotal(orders.getPayAccount().intValue()); request.setAmount(amount); // PrepayResponse res = WxMiniConfig.wxPayService.prepay(request); // è·ä¹åä¸å示ä¾ä¸æ ·ï¼å¡«å é¢ä¸ååæ° PrepayWithRequestPaymentResponse resParam = WxMiniConfig.jsapiExtService.prepayWithRequestPayment(request,WxMiniConfig.wxProperties.getSubAppId()); response =resParam; return response; request.setTimeStart(DateUtil.DateToString(new Date(), "yyyyMMddHHmmss")); request.setSpbillCreateIp(Constants.getIpAddr()); //微信å°ç¨åº request.setOpenid(openid); response = WxMiniConfig.wxPayService.createOrder(request); PayResponse payResponse = new PayResponse(); payResponse.setResponse(response); payResponse.setOrderId(orders.getId()); payResponse.setPayType(Constants.ZERO); return payResponse; } catch (WxPayException e) { e.printStackTrace(); } throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æ¯ä»å¤±è´¥ï¼"); } /** @@ -2089,7 +2100,6 @@ //æ´æ°ç¼å redisTemplate.opsForValue().set(Constants.RedisKeys.ORDER_CODE,0); } } server/services/src/main/java/com/doumee/service/business/impl/WithdrawalOrdersServiceImpl.java
@@ -2,7 +2,6 @@ import com.alibaba.fastjson.JSONObject; import com.doumee.config.wx.SendWxMessage; import com.doumee.config.wx.TransferToUser; import com.doumee.config.wx.WXPayUtility; import com.doumee.config.wx.WxMiniConfig; import com.doumee.core.constants.Constants; @@ -179,77 +178,7 @@ /************************************ç§»å¨ç«¯æ¥å£*******************************************/ /** * æç°ç³è¯· * @param withdrawalDTO */ @Override @Transactional(rollbackFor = {BusinessException.class,Exception.class}) public TransferToUser.TransferToUserResponse applyWithdrawal(WithdrawalDTO withdrawalDTO){ if(Objects.isNull(withdrawalDTO) || Objects.isNull(withdrawalDTO.getAmount()) || org.apache.commons.lang3.StringUtils.isBlank(withdrawalDTO.getName()) || withdrawalDTO.getAmount().compareTo(BigDecimal.ZERO)<=Constants.ZERO ){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } Member member = memberMapper.selectById(withdrawalDTO.getMember().getId()); if(Objects.isNull(member)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ç¨æ·ä¿¡æ¯å¼å¸¸,请è系管çå"); } if(member.getAmount() < withdrawalDTO.getAmount().multiply(new BigDecimal("100")).intValue()){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼å¯æç°ä½é¢ä¸è¶³ã"); } if(StringUtils.isEmpty(member.getName())){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"请å å»ç»´æ¤çå®å§ååè¿è¡æç°ç³è¯·"); } WithdrawalOrders withdrawalOrders = new WithdrawalOrders(); withdrawalOrders.setCreateTime(new Date()); withdrawalOrders.setMemberId(member.getId()); withdrawalOrders.setOutBillNo(UUID.randomUUID().toString().replace("-","")); withdrawalOrders.setAmount((withdrawalDTO.getAmount().multiply(new BigDecimal("100"))).longValue()); withdrawalOrders.setStatus(Constants.ZERO); withdrawalOrders.setType(Constants.ZERO); withdrawalOrders.setDeleted(Constants.ZERO); //åèµ·æç°ç³è¯· TransferToUser.TransferToUserRequest transferToUserRequest = new TransferToUser.TransferToUserRequest(); transferToUserRequest.openid = member.getOpenid(); transferToUserRequest.outBillNo = withdrawalOrders.getOutBillNo(); transferToUserRequest.transferAmount = withdrawalOrders.getAmount(); transferToUserRequest.transferRemark = "æç°ç³è¯·"; try { TransferToUser.TransferToUserResponse response = WxMiniConfig.transferToUser.run(transferToUserRequest,withdrawalDTO.getName()); withdrawalOrders.setRemark(JSONObject.toJSONString(response)); if(response.state.name().equals("WAIT_USER_CONFIRM") || response.state.name().equals("ACCEPTED")){ withdrawalOrders.setWxExternalNo(response.transferBillNo); } withdrawalOrdersMapper.insert(withdrawalOrders); //æ´æ°ç¨æ·ä½é¢ memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" AMOUNT = AMOUNT - " + withdrawalOrders.getAmount() ).eq(Member::getId,member.getId())); //å卿µæ°´è®°å½ MemberRevenue memberRevenue = new MemberRevenue(); memberRevenue.setCreateTime(new Date()); memberRevenue.setTransactionNo(withdrawalOrders.getOutBillNo()); memberRevenue.setDeleted(Constants.ZERO); memberRevenue.setMemberId(member.getId()); memberRevenue.setType(Constants.THREE); memberRevenue.setOptType(-Constants.ONE); memberRevenue.setBeforeAmount(member.getAmount()); memberRevenue.setAmount(withdrawalOrders.getAmount()); memberRevenue.setAfterAmount(member.getAmount() - withdrawalOrders.getAmount()); memberRevenue.setObjId(withdrawalOrders.getId()); memberRevenue.setRemark(Constants.RevenueType.getInfo(memberRevenue.getType())); memberRevenue.setObjType(Constants.ONE); memberRevenue.setDeleted(Constants.ZERO); memberRevenue.setStatus(Constants.TWO); memberRevenueMapper.insert(memberRevenue); return response; } catch (WXPayUtility.ApiException e) { String message = JSONObject.parseObject(e.getBody()).getString("message"); throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),message); } } @Override @@ -305,60 +234,6 @@ memberRevenue.setStatus(Constants.ZERO); memberRevenueMapper.insert(memberRevenue); } } } @Override public void cancelTransfer(TransferToUser.CancelTransferRequest request){ if(Objects.isNull(request) || StringUtils.isEmpty(request.outBillNo)){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } WithdrawalOrders withdrawalOrders = withdrawalOrdersMapper.selectOne(new QueryWrapper<WithdrawalOrders>().lambda().eq(WithdrawalOrders::getOutBillNo,request.outBillNo).last("limit 1")); if(Objects.isNull(withdrawalOrders)){ throw new BusinessException(ResponseStatus.DATA_EMPTY); } Member member = memberMapper.selectById(withdrawalOrders.getMemberId()); if(Objects.isNull(member)){ throw new BusinessException(ResponseStatus.DATA_EMPTY); } try { TransferToUser.CancelTransferResponse response = WxMiniConfig.transferToUser.cancelRun(request); if(response.state.equals("CANCELING")){ //æ è®°æç°å¤±è´¥ å å对åºçæç°éé¢ withdrawalOrdersMapper.update(new UpdateWrapper<WithdrawalOrders>() .lambda().set(WithdrawalOrders::getStatus,Constants.TWO) .eq(WithdrawalOrders::getId,withdrawalOrders.getId())); memberRevenueMapper.update(new UpdateWrapper<MemberRevenue>().lambda().set(MemberRevenue::getStatus,Constants.ONE) .set(MemberRevenue::getUpdateTime,new Date()) .eq(MemberRevenue::getObjId,withdrawalOrders.getId())) ; //æ´æ°ç¨æ·ä½é¢ memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" AMOUNT = AMOUNT + " + withdrawalOrders.getAmount() ).eq(Member::getId,withdrawalOrders.getMemberId())); //å卿µæ°´è®°å½ MemberRevenue memberRevenue = new MemberRevenue(); memberRevenue.setCreateTime(new Date()); memberRevenue.setMemberId(withdrawalOrders.getMemberId()); memberRevenue.setType(Constants.FOUR); memberRevenue.setOptType(Constants.ONE); memberRevenue.setBeforeAmount(member.getAmount()); memberRevenue.setAmount(withdrawalOrders.getAmount()); memberRevenue.setAfterAmount(member.getAmount() + withdrawalOrders.getAmount()); memberRevenue.setObjId(withdrawalOrders.getId()); memberRevenue.setObjType(Constants.ONE); memberRevenue.setDeleted(Constants.ZERO); memberRevenue.setStatus(Constants.ZERO); memberRevenueMapper.insert(memberRevenue); } System.out.println(JSONObject.toJSONString(response)); } catch (WXPayUtility.ApiException e) { String message = JSONObject.parseObject(e.getBody()).getString("message"); throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),message); } } server/services/src/main/resources/application-dev.yml
@@ -1,7 +1,7 @@ spring: # æ°æ®æºé ç½® datasource: url: jdbc:mysql://192.168.0.211:3306/jinkuai?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai url: jdbc:mysql://192.168.0.211:3306/gtzxinglijicun?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai username: root password: Doumee@168 driver-class-name: com.mysql.cj.jdbc.Driver @@ -83,82 +83,13 @@ ########################微信æ¯ä»ç¸å ³é ç½®######################## wx: pay: #æå¡å---------start------- åæ°è¯¦è§£å°å https://pay.weixin.qq.com/doc/v3/partner/4013080340 mchId: 1700071922 #æå¡åå¨å¾®ä¿¡æ¯ä»ä¾§çå¯ä¸èº«ä»½æ è¯ appId: wx6cc1087ca79db7f6 #æå¡åå¨å¾®ä¿¡å¼æ¾å¹³å°ï¼ç§»å¨åºç¨ï¼æå ¬ä¼å¹³å°ï¼å ¬ä¼å·/å°ç¨åºï¼ä¸ç³è¯·çä¸ä¸ªå¯ä¸æ è¯ apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142 #7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB serialNumer: 6696086F6EFB8D6A4F821BD47DDBAF75C3BC1209 #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #æå¡åè¯ä¹¦åºåå· payPublicKeyId: PUB_KEY_ID_0117000719222024112700219100000508 #åæ·/平尿¯ä»å ¬é¥id #mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify keyPath: D://jinkuaiPayFile/apiclient_cert.p12 privateCertPath: D://jinkuaiPayFile/apiclient_cert.pem privateKeyPath: D://jinkuaiPayFile/apiclient_key.pem pubKeyPath: D://jinkuaiPayFile/pub_key.pem #åæ·æ¯ä»å ¬é¥ appId: wxcd2b89fd2ff065f8 appSecret: 3462fa186da7cb06c544df8d8664b63a mchId: 1229817002 mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM notifyUrl: https://test.doumee.cn/dmmall_web_api/web/api/wxPayNotify keyPath: D:\DouMee\dmkjWxcert\apiclient_cert.p12 #æå¡å-------------end--- #åæ·ä¿¡æ¯ wechatSerialNumer: 12C0F0DD0F3D2B565B45586D3FEA225EBF723BEC wechatPayPublicKeyId: PUB_KEY_ID_0117233260692025072500181939000603 #åæ·/平尿¯ä»å ¬é¥id wechatPubKeyPath: D://jinkuaiPayFile/shanghu/pub_key.pem #åæ·æ¯ä»å ¬é¥ wechatPrivateKeyPath: D://jinkuaiPayFile/shanghu/apiclient_key.pem #åæ·ç§é¥ wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #åæ·è½¬è´¦åè°å°å wechatApiV3Key: 7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB existsSub: 1 appSecret: #ååæ·------------start---- subMchId: 1723326069 #ååæ·å· subAppId: wx332441ae5b12be7d #å°ç¨åºid subAppSecret: add86d6406f5c14501ac5bbb1a60e004 #å°ç¨åºç§é¥ #ååæ·------------end---- # mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM typeId: jinkuai #wx: # pay: # #æå¡å---------start------- # appId: wx48fd8faa35cc8277 # mchId: 1661770902 # apiV3Key: iF3kC8pL8dZ9iU3hN5fX9zI6eF4xQ6fT # serialNumer: 368B835A194384FD583B83B77977B84127D2F655 # mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S # notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify # refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify ## notifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxPayNotify ## refundNotifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxRefundNotify # #keyPath: /usr/local/aliConfig/bike/apiclient_cert.p12 # #privateCertPath: /usr/local/aliConfig/bike/apiclient_cert.pem # #privateKeyPath: /usr/local/aliConfig/bike/apiclient_key.pem # keyPath: /usr/local/zhengshu/apiclient_cert.p12 #d://apiclient_cert.p12 # privateCertPath: /usr/local/zhengshu/apiclient_cert.pem #d://apiclient_cert.pem # privateKeyPath: /usr/local/zhengshu/apiclient_key.pem #d://apiclient_key.pem # # # #åæ·ä¿¡æ¯ # wechatSerialNumer: 3C9A32FB6CD453FAAAF97F9737ECAEA9D6625727 # wechatPayPublicKeyId: 47E172124E73E8098A565E971064C20ACDE7C911 # PUB_KEY_ID_0116617720032025071800291849000801 #åæ·/平尿¯ä»å ¬é¥id # wechatPubKeyPath: /usr/local/zhengshu/pub_key.pem #d://pub_key.pem #åæ·æ¯ä»å ¬é¥ # #wechatPlatformPubKeyPath: d:/wechatpay_47E172124E73E8098A565E971064C20ACDE7C911.pem #平尿¯ä»å ¬é¥ # wechatPrivateKeyPath: /usr/local/zhengshu/wechatApiclient_key.pem #d://wechatApiclient_key.pem #åæ·ç§é¥ # wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #åæ·è½¬è´¦åè°å°å # #wechatApiV3Key: V4PRKUBTK2BKNKJAD9NSI9YFG2Q0EOT1 #åæ·APIV3Key # # # #æå¡å-------------end--- # existsSub: 1 # appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24 # #ååæ·------------start---- # subAppId: wxcd2b89fd2ff065f8 #wxcd2b89fd2ff065f8 # subAppSecret: 3462fa186da7cb06c544df8d8664b63a #3336812504c830b1c3c5243f9ece407a # subMchId: 1661772003 # subMchKey: EVM8E15TKXE0OEMJFC0V6UFVIOZ5CSQS # #ååæ·------------end---- # # mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM # typeId: gybike upload: type: ftp server/services/src/main/resources/application-pro.yml
@@ -1,9 +1,9 @@ spring: # æ°æ®æºé ç½® datasource: url: jdbc:mysql://b66cc1a382964a6a9d46a522f2dfe672in01.internal.cn-south-1.mysql.rds.myhuaweicloud.com:3306/jinkuai?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai url: jdbc:mysql://192.168.0.211:3306/gtzxinglijicun?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai username: root password: Jinkuai!@#$%^ password: Doumee@168 driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource redis: server/services/src/main/resources/application-test.yml
@@ -1,7 +1,7 @@ spring: # æ°æ®æºé ç½® datasource: url: jdbc:mysql://192.168.0.211:3306/jinkuai?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai url: jdbc:mysql://192.168.0.211:3306/gtzxinglijicun?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai username: root password: Doumee@168 driver-class-name: com.mysql.cj.jdbc.Driver server/web/pom.xml
@@ -52,7 +52,7 @@ <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <mainClass>com.doumee.JKWebApplication</mainClass> <mainClass>com.doumee.GTWebApplication</mainClass> <layout>ZIP</layout> </configuration> <executions> server/web/src/main/java/com/doumee/GTWebApplication.java
ÎļþÃû´Ó server/web/src/main/java/com/doumee/JKWebApplication.java ÐÞ¸Ä @@ -4,7 +4,6 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.ApplicationContext; import org.springframework.scheduling.annotation.EnableAsync; @@ -18,9 +17,9 @@ @SpringBootApplication @MapperScan("com.doumee.dao") @EnableAsync public class JKWebApplication extends SpringBootServletInitializer { public class GTWebApplication extends SpringBootServletInitializer { public static void main(String[] args) { ApplicationContext context = SpringApplication.run(JKWebApplication.class); ApplicationContext context = SpringApplication.run(GTWebApplication.class); context.getEnvironment(); } server/web/src/main/java/com/doumee/api/web/UserApi.java
@@ -1,6 +1,5 @@ package com.doumee.api.web; import com.doumee.config.wx.TransferToUser; import com.doumee.core.annotation.LoginRequired; import com.doumee.core.annotation.trace.Trace; import com.doumee.core.model.ApiResponse; @@ -159,29 +158,7 @@ return ApiResponse.success(memberRevenueService.findPage(pageWrap)); } @LoginRequired @ApiOperation("æç°ç³è¯·") @PostMapping("/applyWithdrawal") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), }) public ApiResponse<TransferToUser.TransferToUserResponse> applyWithdrawal (@RequestBody WithdrawalDTO withdrawalDTO) { withdrawalDTO.setMember(this.getMemberResponse()); return ApiResponse.success("æä½æå",withdrawalOrdersService.applyWithdrawal(withdrawalDTO)); } @LoginRequired @ApiOperation("æ¤éæç°ç³è¯·") @PostMapping("/cancelTransfer") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), }) public ApiResponse cancelTransfer (@RequestBody TransferToUser.CancelTransferRequest request) { withdrawalOrdersService.cancelTransfer(request); return ApiResponse.success("æä½æå"); } }