mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
Merge branch 'dev' of http://192.168.2.46:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -10,6 +10,7 @@ import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.common.util.file.AliyunOssUploadUtils;
|
||||
import com.jsowell.common.util.file.FileUtils;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
@@ -53,12 +54,11 @@ public class JumpController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询充电桩详情
|
||||
* http://localhost:8080/app-xcx-h5/pile/pileDetail/{pileSn}
|
||||
*/
|
||||
@GetMapping("/pile/pileDetail/{pileSn}")
|
||||
public RestApiResponse<?> getPileDetail(HttpServletRequest request, @PathVariable("pileSn") String pileSn) {
|
||||
// logger.info("app-xcx-h5查询充电桩详情 param:{}", pileSn);
|
||||
logger.info("User-Agent:{}", request.getHeader("user-agent"));
|
||||
logger.debug("User-Agent:{}", request.getHeader("user-agent"));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
// 如果对接了类似华为平台的第三方平台,先修改一下枪口状态
|
||||
@@ -111,10 +111,11 @@ public class JumpController extends BaseController {
|
||||
public RestApiResponse<?> getConnectorDetail(HttpServletRequest request, @PathVariable("pileConnectorCode") String pileConnectorCode) {
|
||||
// logger.info("app-xcx-h5查询充电枪口详情 param:{}", pileConnectorCode);
|
||||
String requestSource = UserAgentUtils.determineRequestSource(request);
|
||||
logger.info("查询充电枪口详情-User-Agent:{}, 请求来源:{}", request.getHeader("user-agent"), requestSource);
|
||||
logger.debug("查询充电枪口详情-User-Agent:{}, 请求来源:{}", request.getHeader("user-agent"), requestSource);
|
||||
RestApiResponse<?> response = null;
|
||||
// 截取桩号
|
||||
String pileSn = StringUtils.substring(pileConnectorCode, 0, 14);
|
||||
// String pileSn = StringUtils.substring(pileConnectorCode, 0, 14);
|
||||
String pileSn = YKCUtils.getPileSn(pileConnectorCode);
|
||||
|
||||
try {
|
||||
// 如果对接了类似华为平台的第三方平台,先修改一下枪口状态
|
||||
|
||||
@@ -153,7 +153,7 @@ public class OrderController extends BaseController {
|
||||
logger.error("查询订单信息 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_ORDER_INFO_BY_MEMBER_ID_ERROR);
|
||||
}
|
||||
logger.info("查询订单信息, param:{}, result:{}", JSON.toJSONString(dto), JSON.toJSONString(response));
|
||||
logger.debug("查询订单信息, param:{}, result:{}", JSON.toJSONString(dto), JSON.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class OrderController extends BaseController {
|
||||
logger.error("小程序获取订单详情 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_ORDER_DETAIL_ERROR);
|
||||
}
|
||||
logger.info("小程序获取订单详情, orderCode:{}, result:{}", dto.getOrderCode(), JSON.toJSONString(response));
|
||||
// logger.info("小程序获取订单详情, orderCode:{}, result:{}", dto.getOrderCode(), JSON.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class PileController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/selectConnectorListByParams")
|
||||
public RestApiResponse<?> selectConnectorListByParams(HttpServletRequest request, @RequestBody QueryConnectorListDTO dto) {
|
||||
logger.info("查询充电枪口列表 params:{}", JSON.toJSONString(dto));
|
||||
logger.debug("查询充电枪口列表 params:{}", JSON.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
PageResponse pageResponse = pileConnectorInfoService.getUniAppConnectorInfoListByParams(dto);
|
||||
@@ -128,7 +128,7 @@ public class PileController extends BaseController {
|
||||
logger.error("查询充电枪口列表异常", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_CONNECTOR_INFO_BY_STATION_ID_ERROR);
|
||||
}
|
||||
logger.info("查询充电枪口列表 result:{}", response);
|
||||
logger.debug("查询充电枪口列表 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -141,15 +141,8 @@ public class PileController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/selectStationConnectorList")
|
||||
public RestApiResponse<?> selectStationConnectorList(HttpServletRequest request, @RequestBody QueryConnectorListDTO dto) {
|
||||
logger.info("查询充电枪口列表 params:{}", JSON.toJSONString(dto));
|
||||
logger.debug("查询充电枪口列表 params:{}", JSON.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
// try {
|
||||
// // 查询对接第三方平台的枪口状态
|
||||
// selectThirdPartyConnectorStatus(dto);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("修改对接第三方平台的枪口状态 error");
|
||||
// }
|
||||
|
||||
try {
|
||||
PageResponse pageResponse = pileConnectorInfoService.selectStationConnectorList(dto);
|
||||
response = new RestApiResponse<>(pageResponse);
|
||||
@@ -157,7 +150,7 @@ public class PileController extends BaseController {
|
||||
logger.error("查询充电枪口列表异常", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_CONNECTOR_INFO_BY_STATION_ID_ERROR);
|
||||
}
|
||||
logger.info("查询充电枪口列表 result:{}", response);
|
||||
logger.debug("查询充电枪口列表, params:{}, result:{}", JSON.toJSONString(dto), response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.ykcCommond.ReservationChargingCommand;
|
||||
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
|
||||
@@ -72,6 +73,30 @@ public class TempController extends BaseController {
|
||||
@Autowired
|
||||
private PileRemoteService pileRemoteService;
|
||||
|
||||
@Autowired
|
||||
private EBikeSendCommandService eBikeSendCommandService;
|
||||
|
||||
/**
|
||||
* 电单车开始充电
|
||||
* http://localhost:8080/temp/tempStartCharging
|
||||
*/
|
||||
@PostMapping("/tempStartCharging")
|
||||
public RestApiResponse<?> tempStartCharging(@RequestBody QueryOrderDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
StartChargingCommand command = StartChargingCommand.builder()
|
||||
.pileSn(dto.getPileSn())
|
||||
.connectorCode(dto.getConnectorCode())
|
||||
.build();
|
||||
eBikeSendCommandService.sendStartChargingCommand(command);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (Exception e) {
|
||||
logger.error("电单车开始充电 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_FAILED);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对时
|
||||
* http://localhost:8080/temp/proofreadTimeTest
|
||||
|
||||
@@ -55,6 +55,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -1093,7 +1094,8 @@ public class OrderService {
|
||||
* @param data
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
private void paymentSucceeded(String data) throws JsonProcessingException {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void paymentSucceeded(String data) throws JsonProcessingException {
|
||||
// 验签成功 保存到回调记录表中
|
||||
JSONObject jsonObject = JSON.parseObject(data);
|
||||
log.info("adapay支付成功回调:{}", jsonObject.toJSONString());
|
||||
@@ -1162,10 +1164,16 @@ public class OrderService {
|
||||
paymentInfo.setPaymentId(paymentId);
|
||||
paymentInfo.setAmount(amount.toString());
|
||||
|
||||
String payModel = OrderPayRecordEnum.WECHATPAY_PAYMENT.getValue();
|
||||
String payChannel = jsonObject.getString("pay_channel");
|
||||
if (StringUtils.isNotEmpty(payChannel) && AdapayPayChannelEnum.ALIPAY_LITE.getValue().equals(payChannel)) {
|
||||
payModel = OrderPayRecordEnum.ALIPAY_PAYMENT.getValue();
|
||||
}
|
||||
|
||||
// 记录订单支付流水
|
||||
OrderPayRecord orderPayRecord = OrderPayRecord.builder()
|
||||
.orderCode(orderCode)
|
||||
.payMode(OrderPayRecordEnum.WECHATPAY_PAYMENT.getValue())
|
||||
.payMode(payModel)
|
||||
.paymentId(paymentId)
|
||||
.payAmount(amount)
|
||||
.acquirer(AcquirerEnum.ADAPAY.getValue())
|
||||
|
||||
@@ -12,24 +12,17 @@ import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.*;
|
||||
import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.util.SnUtils;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.transaction.dto.PileTransactionDTO;
|
||||
import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.PersonPileRealTimeVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.PileConnectorDetailVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.AppletPileDetailVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.*;
|
||||
import com.jsowell.pile.vo.web.PileDetailVO;
|
||||
import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -42,13 +35,12 @@ import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PileService {
|
||||
private final Logger log = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Autowired
|
||||
private TransactionService pileTransactionService;
|
||||
|
||||
@Resource
|
||||
private SnUtils snUtils;
|
||||
private PileSnGenerateService snUtils;
|
||||
|
||||
@Autowired
|
||||
private PileBasicInfoService pileBasicInfoService;
|
||||
@@ -163,23 +155,23 @@ public class PileService {
|
||||
if (StringUtils.isBlank(param)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
String pileSn;
|
||||
String pileSn = YKCUtils.getPileSn(param);
|
||||
// param长度大于10是汽车桩, 否则是电单车桩
|
||||
if (param.length() > 10) {
|
||||
// 汽车桩, 桩编号14位, 枪口号2位
|
||||
if (param.length() == 16) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
} else {
|
||||
pileSn = param;
|
||||
}
|
||||
} else {
|
||||
// 电单车桩, 桩编号8位, 枪口号2位
|
||||
if (param.length() == 10) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
} else {
|
||||
pileSn = param;
|
||||
}
|
||||
}
|
||||
// if (param.length() > 10) {
|
||||
// // 汽车桩, 桩编号14位, 枪口号2位
|
||||
// if (param.length() == 16) {
|
||||
// pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
// } else {
|
||||
// pileSn = param;
|
||||
// }
|
||||
// } else {
|
||||
// // 电单车桩, 桩编号8位, 枪口号2位
|
||||
// if (param.length() == 10) {
|
||||
// pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
// } else {
|
||||
// pileSn = param;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 查询充电桩信息
|
||||
PileInfoVO pileInfoVO = pileBasicInfoService.selectPileInfoBySn(pileSn);
|
||||
|
||||
Reference in New Issue
Block a user