update 打印日志

This commit is contained in:
2024-03-19 16:22:40 +08:00
parent f079021ca4
commit 6a6ed9f311
92 changed files with 412 additions and 440 deletions

View File

@@ -134,7 +134,7 @@ public class AdapayService {
createAdaPaymentParam.setDescription(JSON.toJSONString(map));
// 异步通知地址url为http/https路径服务器POST回调URL 上请勿附带参数
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
createAdaPaymentParam.setExpend(JSONObject.toJSONString(ImmutableMap.of("open_id", openId)));
createAdaPaymentParam.setExpend(JSON.toJSONString(ImmutableMap.of("open_id", openId)));
// 延时分账
if (StringUtils.isNotBlank(payMode)) {

View File

@@ -588,7 +588,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
this.cleanCacheByOrderCode(orderBasicInfo.getOrderCode(), orderBasicInfo.getTransactionCode());
int i = orderBasicInfoMapper.updateOrderBasicInfo(orderBasicInfo);
CompletableFuture.runAsync(() -> this.cleanCacheByOrderCode(orderBasicInfo.getOrderCode(), orderBasicInfo.getTransactionCode()));
logger.info("修改订单updateOrderBasicInfo:{}", JSONObject.toJSONString(orderBasicInfo));
logger.info("修改订单updateOrderBasicInfo:{}", JSON.toJSONString(orderBasicInfo));
return i;
}
@@ -1105,7 +1105,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
// 计算需要退回的金额
Map<String, BigDecimal> returnAmountMap = calculateReturnAmount(principalPay, null, orderAmount);
logger.info("结算订单:{}, 剩余金额退回余额, 订单消费金额:{}, 本金支付金额:{}, 赠送支付金额:{}, 退回金额map:{}",
orderCode, orderAmount, principalPay, null, JSONObject.toJSONString(returnAmountMap));
orderCode, orderAmount, principalPay, null, JSON.toJSONString(returnAmountMap));
// 需要退回本金的金额
BigDecimal returnPrincipal = returnAmountMap.get("returnPrincipal");
@@ -1634,7 +1634,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
OrderMonitorData record = new OrderMonitorData();
record.setOrderCode(orderCode);
record.setTransactionCode(transactionCode);
record.setMonitorData(JSONObject.toJSONString(list));
record.setMonitorData(JSON.toJSONString(list));
int insert = orderMonitorDataService.insertSelective(record);
if (insert > 0) {
// 删除redis中缓存
@@ -1708,10 +1708,10 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
String refundType = dto.getRefundType();
if (StringUtils.equals(refundType, "1")) {
WechatPayRefundResponse response = refundOrderWithWechatPay(dto);
logger.info("订单结算退款 result:{}", JSONObject.toJSONString(response));
logger.info("订单结算退款 result:{}", JSON.toJSONString(response));
} else if (StringUtils.equals(refundType, "2")) {
WechatPayRefundResponse response = refundBalanceWithWechatPay(dto);
logger.info("用户余额退款 result:{}", JSONObject.toJSONString(response));
logger.info("用户余额退款 result:{}", JSON.toJSONString(response));
} else {
logger.warn("没有找到退款处理逻辑");
}
@@ -2230,7 +2230,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
for (WechatPayRefundRequest refundRequest : requestList) {
try {
WechatPayRefundResponse wechatPayRefundResponse = wechatPayService.ApplyForWechatPayRefundV3(refundRequest);
logger.info("调微信退款API退款====={}", JSONObject.toJSONString(wechatPayRefundResponse));
logger.info("调微信退款API退款====={}", JSON.toJSONString(wechatPayRefundResponse));
} catch (Exception e) {
logger.error("调微信退款API发生异常", e);
}
@@ -2943,7 +2943,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
@Override
public OrderBasicInfo generateOrder(GenerateOrderDTO dto) throws ParseException {
logger.info("generateOrder param:{}", JSONObject.toJSONString(dto));
logger.info("generateOrder param:{}", JSON.toJSONString(dto));
// 处理前端传的参数
analysisPileParameter(dto);
@@ -3532,7 +3532,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
// 订单详情
BillingTemplateVO billingTemplate = dto.getBillingTemplate();
logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSONObject.toJSONString(billingTemplate));
logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSON.toJSONString(billingTemplate));
BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;

View File

@@ -1,6 +1,6 @@
package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.Lists;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
@@ -241,7 +241,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
private List<PileDetailVO> queryPileListByStatus(QueryPileDTO dto) {
// StopWatch watch = new StopWatch("查询充电桩信息");
// watch.start("首先不分页查询所有符合条件的充电桩");
log.info("queryPileInfos dto:{}", JSONObject.toJSONString(dto));
log.info("queryPileInfos dto:{}", JSON.toJSONString(dto));
// 首先不分页查询所有符合条件的充电桩
List<PileDetailVO> pileInfoVOS = queryPileInfoList(dto);
// watch.stop();
@@ -249,13 +249,13 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
// watch.start("查询充电桩状态");
// 获取桩sn列表
List<String> pileSnList = pileInfoVOS.stream().map(PileDetailVO::getPileSn).collect(Collectors.toList());
// log.info("获取桩sn列表:{}", JSONObject.toJSONString(pileSnList));
// log.info("获取桩sn列表:{}", JSON.toJSONString(pileSnList));
// 批量获取桩状态 key:桩编号; value:状态
Map<String, String> pileStatusMap = pileConnectorInfoService.getPileStatus(pileSnList);
// watch.stop();
// watch.start("根据状态过滤");
// log.info("批量获取桩状态:{}", JSONObject.toJSONString(pileStatusMap));
// log.info("批量获取桩状态:{}", JSON.toJSONString(pileStatusMap));
// 根据状态过滤
List<String> snList = Lists.newArrayList();
if (StringUtils.isNotBlank(dto.getStatus())) {
@@ -564,7 +564,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
.multiply(new BigDecimal(realTimeMonitorData.getOutputCurrent())).setScale(2, RoundingMode.HALF_UP).toString();
realTimeMonitorData.setOutputPower(power);
// 保存json字符串
String jsonMsg = JSONObject.toJSONString(realTimeMonitorData);
String jsonMsg = JSON.toJSONString(realTimeMonitorData);
// 上传实时数据每10秒发送一次1分钟6次在同一分钟内只保留最后一条实时数据
redisCache.hset(redisKey, DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:00", now), jsonMsg);
@@ -731,7 +731,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
.collect(Collectors.toList());
stationIdList.addAll(stationList);
}
log.info("后管首页基本信息查询 authorizedMap:{}, dto:{}", JSONObject.toJSONString(authorizedMap), JSONObject.toJSONString(dto));
log.info("后管首页基本信息查询 authorizedMap:{}, dto:{}", JSON.toJSONString(authorizedMap), JSON.toJSONString(dto));
dto.setStationIdList(stationIdList);
// IndexGeneralSituationVO generalInfo = pileBasicInfoMapper.getGeneralSituation(dto);
IndexGeneralSituationVO generalInfo = pileBasicInfoMapper.getGeneralSituationInfo(dto);
@@ -750,12 +750,12 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
// demo账号
if (SecurityUtils.getUsername().equals("demo")) {
BigDecimal bigDecimal = new BigDecimal(Constants.THREE);
log.info("demo账号, begin:{}", JSONObject.toJSONString(generalInfo));
log.info("demo账号, begin:{}", JSON.toJSONString(generalInfo));
generalInfo.setTotalChargingAmount(new BigDecimal(generalInfo.getTotalChargingAmount()).multiply(bigDecimal).toString());
generalInfo.setTotalPileQuantity(new BigDecimal(generalInfo.getTotalPileQuantity()).multiply(bigDecimal).toString());
generalInfo.setTotalChargingDegree(new BigDecimal(generalInfo.getTotalChargingDegree()).multiply(bigDecimal).toString());
generalInfo.setTotalChargingQuantity(new BigDecimal(generalInfo.getTotalChargingQuantity()).multiply(bigDecimal).toString());
log.info("demo账号, end:{}", JSONObject.toJSONString(generalInfo));
log.info("demo账号, end:{}", JSON.toJSONString(generalInfo));
}
return generalInfo;
}

View File

@@ -1,6 +1,6 @@
package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.primitives.Bytes;
@@ -690,7 +690,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
EchoBillingTemplateVO echoBillingTemplateVO = queryPileBillingTemplateById(Long.parseLong(billingTemplateVO.getTemplateId()));
// 时段清单
List<BillingTimeDTO> timeArray = echoBillingTemplateVO.getTimeArray();
log.info("计费模板时段:{}", JSONObject.toJSONString(timeArray));
log.info("计费模板时段:{}", JSON.toJSONString(timeArray));
List<BillingPriceVO> resultList = Lists.newArrayList();
for (BillingTimeDTO billingTimeDTO : timeArray) {
@@ -761,7 +761,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
EchoBillingTemplateVO echoBillingTemplateVO = queryPileBillingTemplateById(Long.parseLong(billingTemplateVO.getTemplateId()));
// 时段清单
List<BillingTimeDTO> timeArray = echoBillingTemplateVO.getTimeArray();
log.info("计费模板时段:{}", JSONObject.toJSONString(timeArray));
log.info("计费模板时段:{}", JSON.toJSONString(timeArray));
List<BillingPriceVO> resultList = Lists.newArrayList();
for (BillingTimeDTO billingTimeDTO : timeArray) {

View File

@@ -1,6 +1,6 @@
package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
@@ -38,7 +38,10 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import java.math.BigDecimal;
import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -495,7 +498,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
BigDecimal instantPower = instantPowerTemp.divide(new BigDecimal(1000), 2, BigDecimal.ROUND_HALF_UP);
pileConnectorInfoVO.setInstantPower(instantPower);
log.info("枪口实时数据:{}", JSONObject.toJSONString(pileConnectorInfoVO));
log.info("枪口实时数据:{}", JSON.toJSONString(pileConnectorInfoVO));
}
// 查缓存是否故障
String redisKey = CacheConstants.PILE_HARDWARE_FAULT + pileConnectorInfoVO.getPileConnectorCode();

View File

@@ -694,7 +694,7 @@ public abstract class AbstractProgramLogic implements InitializingBean {
OrderMonitorData record = new OrderMonitorData();
record.setOrderCode(orderCode);
record.setTransactionCode(transactionCode);
record.setMonitorData(JSONObject.toJSONString(list));
record.setMonitorData(JSON.toJSONString(list));
int insert = orderMonitorDataService.insertSelective(record);
if (insert > 0) {
// 删除redis中缓存
@@ -805,7 +805,7 @@ public abstract class AbstractProgramLogic implements InitializingBean {
//
// // 订单详情
// BillingTemplateVO billingTemplate = dto.getBillingTemplate();
// logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSONObject.toJSONString(billingTemplate));
// logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSON.toJSONString(billingTemplate));
// BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
// BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
// BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;

View File

@@ -65,7 +65,7 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
*/
@Override
public OrderBasicInfo generateOrder(GenerateOrderDTO dto) throws ParseException {
logger.info("【{}】-生成订单start, param:{}", this.getClass().getSimpleName(), JSONObject.toJSONString(dto));
logger.info("【{}】-生成订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto));
// 处理前端传的参数
orderBasicInfoService.analysisPileParameter(dto);
@@ -403,7 +403,7 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
// 从redis中取出实时记录保存到表中
realTimeMonitorDataRedis2DB(orderBasicInfo.getTransactionCode(), orderBasicInfo.getOrderCode());
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderBasicInfo.getOrderCode(), JSONObject.toJSONString(dto));
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderBasicInfo.getOrderCode(), JSON.toJSONString(dto));
}
// uniApp 发送停止充电订阅消息
@@ -486,7 +486,7 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
createAdaPaymentParam.setGoods_title(goodsTitle);
createAdaPaymentParam.setGoods_desc(goodsDesc);
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();
@@ -499,9 +499,9 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
createAdaPaymentParam.setPay_mode(payMode);
}
try {
logger.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
logger.info("创建汇付支付参数:{}", JSON.toJSONString(createAdaPaymentParam));
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam), config.getWechatAppId());
logger.info("创建汇付支付参数反参:{}", JSONObject.toJSONString(response));
logger.info("创建汇付支付参数反参:{}", JSON.toJSONString(response));
if (response != null && !response.isEmpty()) {
JSONObject jsonObject = JSONObject.parseObject(response.get("expend").toString());
JSONObject pay_info = jsonObject.getJSONObject("pay_info");
@@ -639,7 +639,7 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
// 计算需要退回的金额
Map<String, BigDecimal> returnAmountMap = calculateReturnAmount(principalPay, giftPay, orderAmount, discountAmount);
logger.info("结算订单:{}, 剩余金额退回余额, 订单消费金额:{}, 本金支付金额:{}, 赠送支付金额:{}, 退回金额map:{}",
orderCode, orderAmount, principalPay, null, JSONObject.toJSONString(returnAmountMap));
orderCode, orderAmount, principalPay, null, JSON.toJSONString(returnAmountMap));
// 需要退回本金的金额
BigDecimal returnPrincipal = returnAmountMap.get("returnPrincipal");

View File

@@ -67,7 +67,7 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
*/
@Override
public OrderBasicInfo generateOrder(GenerateOrderDTO dto) throws ParseException {
logger.info("【{}】-生成订单start, param:{}", this.getClass().getSimpleName(), JSONObject.toJSONString(dto));
logger.info("【{}】-生成订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto));
// 处理前端传的参数
orderBasicInfoService.analysisPileParameter(dto);
@@ -157,7 +157,7 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
//
// // 订单详情
// BillingTemplateVO billingTemplate = dto.getBillingTemplate();
// logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSONObject.toJSONString(billingTemplate));
// logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSON.toJSONString(billingTemplate));
// BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
// BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
// BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;
@@ -410,7 +410,7 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
// TODO 如果该站点的停车场优惠券信息配置不为空,则需绑定一张优惠券
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderBasicInfo.getOrderCode(), JSONObject.toJSONString(dto));
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderBasicInfo.getOrderCode(), JSON.toJSONString(dto));
}
@Override
@@ -477,7 +477,7 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
createAdaPaymentParam.setGoods_title(goodsTitle);
createAdaPaymentParam.setGoods_desc(goodsDesc);
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();
@@ -486,9 +486,9 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
map.put("memberId", dto.getMemberId());
createAdaPaymentParam.setDescription(JSON.toJSONString(map));
try {
logger.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));
logger.info("创建汇付支付参数:{}", JSON.toJSONString(createAdaPaymentParam));
Map<String, Object> response = Payment.create(BeanMap.create(createAdaPaymentParam), config.getWechatAppId());
logger.info("创建汇付支付参数反参:{}", JSONObject.toJSONString(response));
logger.info("创建汇付支付参数反参:{}", JSON.toJSONString(response));
if (response != null && !response.isEmpty()) {
JSONObject jsonObject = JSONObject.parseObject(response.get("expend").toString());
JSONObject pay_info = jsonObject.getJSONObject("pay_info");
@@ -634,7 +634,7 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
// 计算需要退回的金额
Map<String, BigDecimal> returnAmountMap = calculateReturnAmount(principalPay, null, orderAmount);
logger.info("结算订单:{}, 剩余金额退回余额, 订单消费金额:{}, 本金支付金额:{}, 赠送支付金额:{}, 退回金额map:{}",
orderCode, orderAmount, principalPay, null, JSONObject.toJSONString(returnAmountMap));
orderCode, orderAmount, principalPay, null, JSON.toJSONString(returnAmountMap));
// 需要退回本金的金额
BigDecimal returnPrincipal = returnAmountMap.get("returnPrincipal");

View File

@@ -1,6 +1,6 @@
package com.jsowell.pile.util;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.Lists;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.entity.SysDept;
@@ -69,7 +69,7 @@ public class UserUtils {
}
String deptId = String.valueOf(dept.getDeptId());
resultVO.setDeptId(deptId);
log.info("用户id:{}, 所属部门信息:{}", user.getUserId(), JSONObject.toJSONString(dept));
log.info("用户id:{}, 所属部门信息:{}", user.getUserId(), JSON.toJSONString(dept));
// 登录用户角色
Long parentId = dept.getParentId();
resultVO.setParentId(String.valueOf(parentId));