# Conflicts:
#	jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java
This commit is contained in:
Lemon
2024-03-20 08:20:35 +08:00
100 changed files with 473 additions and 493 deletions

View File

@@ -591,7 +591,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;
}
@@ -1108,7 +1108,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");
@@ -1637,7 +1637,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中缓存
@@ -1711,10 +1711,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("没有找到退款处理逻辑");
}
@@ -2233,7 +2233,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);
}
@@ -2946,7 +2946,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);
@@ -3548,7 +3548,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

@@ -101,19 +101,20 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
byte[] writeMsg = Bytes.concat(head, length, temp, crc);
// 返回完整的报文 string类型
String wholeMsg= BytesUtil.binary(writeMsg, 16);
log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg);
// log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg);
ByteBuf byteBuf = channel.alloc().buffer().writeBytes(writeMsg);
ChannelFuture channelFuture = channel.writeAndFlush(byteBuf);
channelFuture.addListener((ChannelFutureListener) channelFutureListener -> {
// 检查操作的状态
if (channelFutureListener.isSuccess()) {
log.info("push结果【成功】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}", channel.remoteAddress(), channel.id(), value, wholeMsg);
log.info("push结果【成功】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
pileSn, channel.remoteAddress(), channel.id(), value, wholeMsg);
} else {
// 如果发生错误则访问描述原因的Throwable
Throwable cause = channelFutureListener.cause();
// cause.printStackTrace();
log.info("push结果【失败】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}", channel.remoteAddress(), channel.id(), value, wholeMsg);
log.error("push发送命令失败", cause);
log.info("push结果【失败】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
pileSn, channel.remoteAddress(), channel.id(), value, wholeMsg);
log.error("push发送命令失败, pileSn:{}", pileSn, cause);
}
});