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:
@@ -18,7 +18,7 @@ import com.jsowell.pile.service.MemberGroupService;
|
||||
import com.jsowell.pile.service.PileBasicInfoService;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.GroundLockInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.PileConnectorVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.AppletPileDetailVO;
|
||||
import com.jsowell.pile.vo.web.ThirdPartySnRelationVO;
|
||||
import com.jsowell.service.PileService;
|
||||
import com.jsowell.thirdparty.common.CommonService;
|
||||
@@ -70,7 +70,7 @@ public class JumpController extends BaseController {
|
||||
try {
|
||||
// 进入充电桩详情做一下鉴权
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
PileConnectorVO vo = pileService.getPileDetailByPileSn(pileSn);
|
||||
AppletPileDetailVO vo = pileService.getPileDetailByPileSn(pileSn);
|
||||
addMember2MemberGroup(memberId, vo);
|
||||
response = new RestApiResponse<>(vo);
|
||||
} catch (BusinessException e) {
|
||||
@@ -85,7 +85,7 @@ public class JumpController extends BaseController {
|
||||
}
|
||||
|
||||
// 针对汇鑫大厦的用户,自动加入集团中
|
||||
private void addMember2MemberGroup(String memberId, PileConnectorVO vo) {
|
||||
private void addMember2MemberGroup(String memberId, AppletPileDetailVO vo) {
|
||||
if (vo == null || StringUtils.isBlank(memberId)) {
|
||||
return;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class JumpController extends BaseController {
|
||||
memberId = getMemberIdByAuthorization(request);
|
||||
}
|
||||
|
||||
PileConnectorVO vo = pileService.getConnectorDetail(pileConnectorCode);
|
||||
AppletPileDetailVO vo = pileService.getConnectorDetail(pileConnectorCode);
|
||||
if (StringUtils.isNotBlank(memberId)) {
|
||||
addMember2MemberGroup(memberId, vo);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.jsowell.common.util.file.AliyunOssUploadUtils;
|
||||
import com.jsowell.common.util.file.FileUtils;
|
||||
import com.jsowell.pile.service.PileBasicInfoService;
|
||||
import com.jsowell.pile.vo.uniapp.customer.GroundLockInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.PileConnectorVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.AppletPileDetailVO;
|
||||
import com.jsowell.service.PileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -42,7 +42,7 @@ public class JumpXixiaoController extends BaseController {
|
||||
logger.info("User-Agent:{}", request.getHeader("user-agent"));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
PileConnectorVO vo = pileService.getPileDetailByPileSn(pileSn);
|
||||
AppletPileDetailVO vo = pileService.getPileDetailByPileSn(pileSn);
|
||||
response = new RestApiResponse<>(vo);
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("app-xcx-h5查询充电桩详情 warn", e);
|
||||
@@ -65,7 +65,7 @@ public class JumpXixiaoController extends BaseController {
|
||||
logger.info("User-Agent:{}", request.getHeader("user-agent"));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
PileConnectorVO vo = pileService.getConnectorDetail(pileConnectorCode);
|
||||
AppletPileDetailVO vo = pileService.getConnectorDetail(pileConnectorCode);
|
||||
response = new RestApiResponse<>(vo);
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("app-xcx-h5查询充电枪口详情 warn param:{}", pileConnectorCode, e);
|
||||
|
||||
@@ -209,7 +209,7 @@ public class MemberController extends BaseController {
|
||||
logger.error("查询用户账户信息", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_MEMBER_ACCOUNT_AMOUNT_ERROR);
|
||||
}
|
||||
logger.info("查询用户账户信息 param memberId:{}, result:{}", memberId, response);
|
||||
logger.info("查询用户账户信息, param:{}, result:{}", memberId, response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class OccupyOrderController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/getStationOccupyFee/{stationId}")
|
||||
public RestApiResponse<?> getStationOccupyFee(@PathVariable("stationId") String stationId) {
|
||||
logger.info("查询站点占桩费率 params:{}", stationId);
|
||||
// logger.info("查询站点占桩费率 params:{}", stationId);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
BillingTemplateVO vo = pileBillingTemplateService.queryUsedBillingTemplate(stationId);
|
||||
@@ -52,7 +52,7 @@ public class OccupyOrderController extends BaseController {
|
||||
logger.error("查询站点占桩费率 error,", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("查询站点占桩费率 result:{}", response);
|
||||
logger.info("查询站点占桩费率 params:{}, result:{}", stationId, response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class OccupyOrderController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/getOccupyOrderDetail/{occupyCode}")
|
||||
public RestApiResponse<?> getOccupyOrderDetail(@PathVariable("occupyCode") String occupyCode) {
|
||||
logger.info("查询占桩订单详情页 param:{}", occupyCode);
|
||||
// logger.info("查询占桩订单详情页 param:{}", occupyCode);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
OccupyOrderDetailVO vo = orderPileOccupyService.getOccupyOrderDetail(occupyCode);
|
||||
@@ -101,7 +101,7 @@ public class OccupyOrderController extends BaseController {
|
||||
logger.error("查询占桩订单详情页 error,", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("查询占桩订单详情页 result:{}", response);
|
||||
logger.info("查询占桩订单详情页, param:{}, result:{}", occupyCode, response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ public class OrderController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/queryUninvoicedOrderList")
|
||||
public RestApiResponse<?> queryUninvoicedOrderList(HttpServletRequest request, @RequestBody QueryOrderDTO dto) {
|
||||
logger.info("查询未开发票订单 param:{}", JSON.toJSONString(dto));
|
||||
// logger.info("查询未开发票订单 param:{}", JSON.toJSONString(dto));
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
|
||||
@@ -220,7 +220,7 @@ public class PersonPileController extends BaseController {
|
||||
logger.error("获取某枪口某段时间内累计信息 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("获取某枪口某段时间内累计信息 result:{}", response);
|
||||
logger.info("获取某枪口某段时间内累计信息, params:{}, result:{}", JSON.toJSONString(dto), response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class PersonPileController extends BaseController {
|
||||
*/
|
||||
@RequestMapping("/getChargingRecord")
|
||||
public RestApiResponse<?> getChargingRecord(HttpServletRequest request, @RequestBody QueryPersonPileDTO dto) {
|
||||
logger.info("获取个人桩充电记录 params:{}", JSON.toJSONString(dto));
|
||||
// logger.info("获取个人桩充电记录 params:{}", JSON.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
@@ -249,7 +249,7 @@ public class PersonPileController extends BaseController {
|
||||
logger.error("获取个人桩充电记录 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("获取个人桩充电记录 result:{}", response);
|
||||
logger.info("获取个人桩充电记录, params:{}, result:{}", JSON.toJSONString(dto), JSON.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class PileController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/queryStationInfos")
|
||||
public RestApiResponse<?> queryStationInfos(HttpServletRequest request, @RequestBody QueryStationDTO queryStationDTO) {
|
||||
logger.info("查询充电站信息列表 param:{}", JSON.toJSONString(queryStationDTO));
|
||||
// logger.info("查询充电站信息列表 param:{}", JSON.toJSONString(queryStationDTO));
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
// 获取appid(第三方平台用)
|
||||
@@ -73,7 +73,7 @@ public class PileController extends BaseController {
|
||||
List<String> deptIds = pileMerchantInfoService.getDeptIdsByAppId(appId);
|
||||
queryStationDTO.setMerchantDeptIds(deptIds);
|
||||
}
|
||||
logger.info("uniApp查询充电站信息appId:{}, dto:{}", appId, JSON.toJSONString(queryStationDTO));
|
||||
logger.debug("uniApp查询充电站信息appId:{}, dto:{}", appId, JSON.toJSONString(queryStationDTO));
|
||||
PageResponse pageResponse = pileStationInfoService.uniAppQueryStationInfoList(queryStationDTO);
|
||||
response = new RestApiResponse<>(pageResponse);
|
||||
} catch (BusinessException e) {
|
||||
@@ -83,7 +83,7 @@ public class PileController extends BaseController {
|
||||
logger.error("查询充电站信息列表异常 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_STATION_INFO_ERROR);
|
||||
}
|
||||
logger.info("查询充电站信息列表 result:{}", JSON.toJSONString(response));
|
||||
logger.debug("查询充电站信息列表 param:{}, result:{}", JSON.toJSONString(queryStationDTO), JSON.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ 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.PileConnectorVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.AppletPileDetailVO;
|
||||
import com.jsowell.pile.vo.web.PileDetailVO;
|
||||
import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -159,16 +159,28 @@ public class PileService {
|
||||
/**
|
||||
* 前端扫码跳转接口
|
||||
*/
|
||||
public PileConnectorVO getPileDetailByPileSn(String param) throws ExecutionException, InterruptedException {
|
||||
public AppletPileDetailVO getPileDetailByPileSn(String param) throws ExecutionException, InterruptedException {
|
||||
if (StringUtils.isBlank(param)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
String pileSn;
|
||||
if (param.length() == 16) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
// param长度大于10是汽车桩, 否则是电单车桩
|
||||
if (param.length() > 10) {
|
||||
// 汽车桩, 桩编号14位, 枪口号2位
|
||||
if (param.length() == 16) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
} else {
|
||||
pileSn = param;
|
||||
}
|
||||
} else {
|
||||
pileSn = param;
|
||||
// 电单车桩, 桩编号8位, 枪口号2位
|
||||
if (param.length() == 10) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
} else {
|
||||
pileSn = param;
|
||||
}
|
||||
}
|
||||
|
||||
// 查询充电桩信息
|
||||
PileInfoVO pileInfoVO = pileBasicInfoService.selectPileInfoBySn(pileSn);
|
||||
if (pileInfoVO == null) {
|
||||
@@ -207,7 +219,7 @@ public class PileService {
|
||||
MerchantInfoVO merchantInfoVO = merchantInfoVOFuture.get();
|
||||
List<BillingPriceVO> billingPriceVOS = billingPriceFuture.get();
|
||||
|
||||
PileConnectorVO vo = PileConnectorVO.builder()
|
||||
AppletPileDetailVO vo = AppletPileDetailVO.builder()
|
||||
.pileInfo(pileInfoVO)
|
||||
.connectorInfoList(connectorInfoList)
|
||||
.merchantInfo(merchantInfoVO)
|
||||
@@ -225,17 +237,20 @@ public class PileService {
|
||||
* @throws ExecutionException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public PileConnectorVO getConnectorDetail(String pileConnectorCode) throws ExecutionException, InterruptedException {
|
||||
public AppletPileDetailVO getConnectorDetail(String pileConnectorCode) throws ExecutionException, InterruptedException {
|
||||
PileConnectorDetailVO pileConnectorDetailVO = queryPileConnectorDetail(pileConnectorCode);
|
||||
if (pileConnectorDetailVO == null) {
|
||||
return null;
|
||||
}
|
||||
// 枪口状态不为2:占用(未充电)
|
||||
if (!StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), pileConnectorDetailVO.getConnectorStatus())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PILE_CONNECTOR_STATUS_ERROR);
|
||||
// 不是电单车的桩, 需要判断插枪状态
|
||||
if (!StringUtils.equals(Constants.THREE, pileConnectorDetailVO.getChargePortType())) {
|
||||
// 枪口状态不为2:占用(未充电)
|
||||
if (!StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), pileConnectorDetailVO.getConnectorStatus())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PILE_CONNECTOR_STATUS_ERROR);
|
||||
}
|
||||
}
|
||||
String pileSn = pileConnectorDetailVO.getPileSn();
|
||||
PileConnectorVO resultVO = getPileDetailByPileSn(pileSn);
|
||||
AppletPileDetailVO resultVO = getPileDetailByPileSn(pileSn);
|
||||
List<ConnectorInfoVO> connectorInfoList = resultVO.getConnectorInfoList();
|
||||
if (connectorInfoList.size() > 1) {
|
||||
List<ConnectorInfoVO> list = Lists.newArrayList();
|
||||
|
||||
Reference in New Issue
Block a user