mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 打印日志
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
@@ -207,7 +208,7 @@ public class AgentDevService {
|
||||
|
||||
String result = HttpUtils.sendPost(url, jsonObject.toString());
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
logger.info("获取第三方平台 token 请求结果:{}", JSONObject.toJSONString(jsonResult));
|
||||
logger.info("获取第三方平台 token 请求结果:{}", JSON.toJSONString(jsonResult));
|
||||
// 获取返回值中的 token
|
||||
token = jsonResult.getString("component_access_token");
|
||||
if (token == null) {
|
||||
@@ -240,8 +241,8 @@ public class AgentDevService {
|
||||
jsonObject.put("component_appid", PLATFORM_APP_ID);
|
||||
jsonObject.put("authorization_code", authorizationCode);
|
||||
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 使用授权码获取授权信息 请求参数:{}, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 使用授权码获取授权信息 请求参数:{}, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将结果转换成json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
if (Objects.isNull(resultJson)) {
|
||||
@@ -249,7 +250,7 @@ public class AgentDevService {
|
||||
}
|
||||
// AuthInfoVO authInfoVO = (AuthInfoVO) resultJson.get("authorization_info");
|
||||
|
||||
AuthInfoVO authInfoVO = JSONObject.parseObject(JSONObject.toJSONString(resultJson.get("authorization_info")), AuthInfoVO.class);
|
||||
AuthInfoVO authInfoVO = JSONObject.parseObject(JSON.toJSONString(resultJson.get("authorization_info")), AuthInfoVO.class);
|
||||
if (authInfoVO == null) {
|
||||
throw new RuntimeException("获取第三方平台 使用授权码获取授权信息 error");
|
||||
}
|
||||
@@ -305,8 +306,8 @@ public class AgentDevService {
|
||||
jsonObject.put("authorizer_appid", authAppId);
|
||||
jsonObject.put("authorizer_refresh_token", refreshToken);
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 通过刷新令牌获取接口令牌 请求参数:{}\n, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 通过刷新令牌获取接口令牌 请求参数:{}\n, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转成 json 对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
|
||||
@@ -341,12 +342,12 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/wxa/commit?access_token=" + authAccessToken;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("template_id", dto.getTemplateId());
|
||||
jsonObject.put("ext_json", JSONObject.toJSONString(dto.getExtJson()));
|
||||
jsonObject.put("ext_json", JSON.toJSONString(dto.getExtJson()));
|
||||
jsonObject.put("user_version", dto.getUserVersion());
|
||||
jsonObject.put("user_desc", dto.getUserDesc());
|
||||
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 提交代码 请求参数:{}, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 提交代码 请求参数:{}, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
|
||||
@@ -407,13 +408,13 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/wxa/submit_audit?access_token=" + authAccessToken;
|
||||
|
||||
// List --> JsonArray
|
||||
JSONArray itemArray = JSONArray.parseArray(JSONObject.toJSONString(itemList));
|
||||
JSONArray itemArray = JSONArray.parseArray(JSON.toJSONString(itemList));
|
||||
// 发送请求
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("item_list", itemArray);
|
||||
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 提交代码审核 请求参数:{}, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 提交代码审核 请求参数:{}, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
int errCode = (int) resultJson.get("errcode");
|
||||
@@ -450,7 +451,7 @@ public class AgentDevService {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("auditid", dto.getAuditId());
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
int errCode = (int) resultJson.get("errcode");
|
||||
@@ -494,8 +495,8 @@ public class AgentDevService {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("component_appid", PLATFORM_APP_ID);
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 获取预授权码请求 params:{}, result:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 获取预授权码请求 params:{}, result:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转成json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
preAuthCode = resultJson.getString("pre_auth_code");
|
||||
@@ -548,7 +549,7 @@ public class AgentDevService {
|
||||
// }
|
||||
String url = "https://api.weixin.qq.com/wxa/release?access_token=" + authAccessToken;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
// int errCode = (int) resultJson.get("errcode");
|
||||
@@ -603,7 +604,7 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/cgi-bin/component/setprivacysetting?access_token=" + authAccessToken;
|
||||
List<UserInfoSetting> settingList = dto.getSettingList();
|
||||
// 转为 jsonArray
|
||||
JSONArray itemArray = JSONArray.parseArray(JSONObject.toJSONString(settingList));
|
||||
JSONArray itemArray = JSONArray.parseArray(JSON.toJSONString(settingList));
|
||||
// 拼接参数
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("privacy_ver", dto.getPrivacyVer());
|
||||
@@ -611,7 +612,7 @@ public class AgentDevService {
|
||||
jsonObject.put("owner_setting", dto.getOwnerSetting());
|
||||
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 转为 json 对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
|
||||
@@ -647,7 +648,7 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + authAccessToken;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", code);
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 将返回值转成 json 对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
Integer errCode = resultJson.getInteger("errcode");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
@@ -20,8 +21,8 @@ import com.jsowell.pile.dto.camera.Camera2GroundLockCommand;
|
||||
import com.jsowell.pile.dto.camera.CameraHeartBeatDTO;
|
||||
import com.jsowell.pile.dto.camera.CameraIdentifyResultsDTO;
|
||||
import com.jsowell.pile.service.MemberBasicInfoService;
|
||||
import com.jsowell.pile.service.PileCameraInfoService;
|
||||
import com.jsowell.pile.service.OrderPileOccupyService;
|
||||
import com.jsowell.pile.service.PileCameraInfoService;
|
||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.pile.vo.web.OccupyOrderVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -30,13 +31,12 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
||||
@@ -617,7 +617,7 @@ public class MemberService {
|
||||
PaymentScenarioDTO paymentScenarioDTO = new PaymentScenarioDTO();
|
||||
paymentScenarioDTO.setType(ScenarioEnum.BALANCE.getValue());
|
||||
paymentScenarioDTO.setMemberId(dto.getMemberId());
|
||||
dto.setAttach(JSONObject.toJSONString(paymentScenarioDTO));
|
||||
dto.setAttach(JSON.toJSONString(paymentScenarioDTO));
|
||||
dto.setDescription("会员充值余额");
|
||||
return orderService.weixinPayV3(dto);
|
||||
}
|
||||
@@ -648,7 +648,7 @@ public class MemberService {
|
||||
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
|
||||
createAdaPaymentParam.setGoods_title("充值余额");
|
||||
createAdaPaymentParam.setGoods_desc("会员充值余额");
|
||||
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", dto.getOpenId())));
|
||||
createAdaPaymentParam.setExpend(JSON.toJSONString( ImmutableMap.of("open_id", dto.getOpenId())));
|
||||
//异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
||||
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
|
||||
Map<String, String> map = Maps.newHashMap();
|
||||
@@ -661,9 +661,9 @@ public class MemberService {
|
||||
createAdaPaymentParam.setPay_mode(payMode);
|
||||
}
|
||||
try {
|
||||
log.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
|
||||
log.info("创建汇付支付参数:{}", JSON.toJSONString(createAdaPaymentParam));
|
||||
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam), config.getWechatAppId());
|
||||
log.info("创建汇付支付参数反参:{}", JSONObject.toJSONString(response));
|
||||
log.info("创建汇付支付参数反参:{}", JSON.toJSONString(response));
|
||||
if (response != null && !response.isEmpty()) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(response.get("expend").toString());
|
||||
JSONObject pay_info = jsonObject.getJSONObject("pay_info");
|
||||
|
||||
@@ -324,7 +324,7 @@ public class OrderService {
|
||||
* @param dto
|
||||
*/
|
||||
public void weChatRefund(ApplyRefundDTO dto) {
|
||||
log.info("微信退款接口 param:{}", JSONObject.toJSONString(dto));
|
||||
log.info("微信退款接口 param:{}", JSON.toJSONString(dto));
|
||||
orderBasicInfoService.weChatRefund(dto);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user