mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-10 21:10:24 +08:00
Merge branch 'dev' into dev-zza
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.jsowell.api.feign;
|
||||
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.pile.service.PileBasicInfoService;
|
||||
import com.jsowell.pile.service.PileBillingTemplateService;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/jsowellcharger")
|
||||
public class JsowellChargerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private PileBasicInfoService pileBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private PileBillingTemplateService pileBillingTemplateService;
|
||||
|
||||
/**
|
||||
* 获取桩基础信息
|
||||
* http://localhost:8080/jsowellcharger/getPileBasicInfo/88000000000126
|
||||
* @param pileSn
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getPileBasicInfo/{pileSn}")
|
||||
public PileInfoVO getPileBasicInfo(@PathVariable("pileSn") String pileSn) {
|
||||
logger.info("获取桩基础信息 pileSn:{}", pileSn);
|
||||
return pileBasicInfoService.selectPileInfoBySn(pileSn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据桩编号查询计费模板
|
||||
* http://localhost:8080/jsowellcharger/getPileBasicInfo
|
||||
*/
|
||||
@GetMapping("/getPileBillingTemplate/{pileSn}")
|
||||
public BillingTemplateVO getPileBasicInfoByPileSn(@PathVariable("pileSn") String pileSn) {
|
||||
logger.info("根据桩编号查询计费模板 pileSn:{}", pileSn);
|
||||
return pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,7 @@ public class WeiWangKuaiDianController extends ThirdPartyBaseController {
|
||||
*/
|
||||
@PostMapping("/v1/query_start_charge")
|
||||
public CommonResult<?> query_start_charge(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||
// logger.info("{}-请求启动充电 params:{}", platformName, JSON.toJSONString(dto));
|
||||
logger.info("{}-请求启动充电 params:{}", platformName, JSON.toJSONString(dto));
|
||||
try {
|
||||
// 校验令牌
|
||||
if (!verifyToken(request.getHeader("Authorization"))) {
|
||||
|
||||
@@ -805,7 +805,7 @@ public class SpringBootTestController {
|
||||
|
||||
@Test
|
||||
public void selectBillingTemplateDetailByPileSnTest() {
|
||||
String pileSn = "88000000000001";
|
||||
String pileSn = "88000000000126";
|
||||
// 查询充电桩的计费模板
|
||||
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
|
||||
System.out.println(JSON.toJSONString(billingTemplateVO));
|
||||
|
||||
@@ -102,4 +102,9 @@ public class QueryOrderDTO extends BaseEntity {
|
||||
* 车辆vin编号
|
||||
*/
|
||||
private String vinCode;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String plateNumber;
|
||||
}
|
||||
|
||||
@@ -435,8 +435,8 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
||||
if (CollectionUtils.isEmpty(pileSns) && CollectionUtils.isEmpty(connectorIds) && CollectionUtils.isEmpty(connectorCodeList)) {
|
||||
return new PageResponse();
|
||||
}
|
||||
// 分页
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
// 分页 (2025.06.16 改为 先查询数据,再总体手动分页)
|
||||
// PageHelper.startPage(pageNum, pageSize);
|
||||
|
||||
List<PileConnectorInfoVO> pileConnectorInfoList = pileConnectorInfoMapper.getPileConnectorInfoList(pileSns, connectorIds, connectorCodeList);
|
||||
|
||||
@@ -450,11 +450,24 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
||||
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue()), 5); // 离线 → 5
|
||||
}});
|
||||
pileConnectorInfoList.sort(
|
||||
Comparator.comparingInt((PileConnectorInfoVO vo) -> priority.get(vo.getStatus()))
|
||||
.thenComparing(PileConnectorInfoVO::getPileConnectorCode) // 状态相同则按枪口号排序
|
||||
Comparator.comparingInt((PileConnectorInfoVO vo) ->
|
||||
priority.getOrDefault(vo.getStatus(), Integer.MAX_VALUE)) // 未定义状态排最后
|
||||
.thenComparing(PileConnectorInfoVO::getPileConnectorCode,
|
||||
Comparator.nullsLast(Comparator.naturalOrder())) // 处理可能的null值
|
||||
);
|
||||
|
||||
PageInfo<PileConnectorInfoVO> pageInfo = new PageInfo<>(pileConnectorInfoList);
|
||||
// 手动分页(取出当前页的数据)
|
||||
int fromIndex = (pageNum - 1) * pageSize;
|
||||
int toIndex = Math.min(fromIndex + pageSize, pileConnectorInfoList.size());
|
||||
List<PileConnectorInfoVO> pagedList = pileConnectorInfoList.subList(fromIndex, toIndex);
|
||||
|
||||
// PageInfo<PileConnectorInfoVO> pageInfo = new PageInfo<>(pileConnectorInfoList);
|
||||
|
||||
// 构造 PageInfo(注意:PageInfo 需要总记录数)
|
||||
PageInfo<PileConnectorInfoVO> pageInfo = new PageInfo<>(pagedList);
|
||||
pageInfo.setTotal(pileConnectorInfoList.size()); // 设置总记录数
|
||||
pageInfo.setPageNum(pageNum); // 设置当前页码
|
||||
pageInfo.setPageSize(pageSize); // 设置每页大小
|
||||
|
||||
// 查询枪口当前订单
|
||||
for (PileConnectorInfoVO pileConnectorInfoVO : pageInfo.getList()) {
|
||||
|
||||
@@ -1934,6 +1934,9 @@
|
||||
<if test="vinCode != null and vinCode != ''">
|
||||
and t1.vin_code = #{vinCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="plateNumber != null and plateNumber != ''">
|
||||
and t1.plate_number = #{plateNumber,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
|
||||
and t3.dept_id in
|
||||
<foreach close=")" collection="stationDeptIds" item="stationDeptId" open="(" separator=",">
|
||||
|
||||
@@ -197,11 +197,15 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// throw new BusinessException("2", "密钥错误");
|
||||
// }
|
||||
|
||||
String a = "146";
|
||||
/* String a = "146";
|
||||
String s = String.valueOf(a);
|
||||
System.out.println(s);
|
||||
boolean zhiHeMerchant = MerchantUtils.isZhiHeMerchant(s);
|
||||
System.out.println(zhiHeMerchant);
|
||||
System.out.println(zhiHeMerchant);*/
|
||||
|
||||
String pn = "8823000000107601";
|
||||
String pileSn = YKCUtils.getPileSn(pn);
|
||||
System.out.println(pileSn);
|
||||
|
||||
}
|
||||
|
||||
@@ -630,19 +634,6 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
info.setAccountNumber(pileStationInfo.getAccountNumber());
|
||||
}
|
||||
|
||||
// 由于88250000005324在对方测试环境的LC658的站点,因此在这里将站点LC149改为LC658
|
||||
/* if (StringUtils.equals("149", stationId)) {
|
||||
info.setStationID("LC658");
|
||||
}*/
|
||||
|
||||
//正式环境站点149推送时报错,"Msg":"更新站点数据出错。站点ID:LC149,错误信息:站点的所属运营商不能修改",
|
||||
if(StringUtils.equals("149", stationId)){
|
||||
//使用EquipmentOwnerID = MA1JLFUU8
|
||||
info.setEquipmentOwnerID(Constants.OPERATORID_LIANLIAN);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 容量
|
||||
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) {
|
||||
info.setCapacity(pileStationInfo.getCapacity().setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
@@ -1064,11 +1055,6 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
}
|
||||
orderInfo.setChargeDetails(chargeDetails);
|
||||
|
||||
// 由于订单在对方测试环境的LC658的站点,因此在这里将站点LC149改为LC658
|
||||
/* if (orderInfo.getStationID().equals("LC149")){
|
||||
orderInfo.setStationID("LC658");
|
||||
}*/
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
@@ -1594,6 +1580,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
succStat = 1;
|
||||
// 1- 此设备尚未插枪;
|
||||
failReason = 1;
|
||||
failReasonMsg = "此设备尚未插枪";
|
||||
}
|
||||
vo.setEquipAuthSeq(equipAuthSeq);
|
||||
vo.setConnectorID(pileConnectorCode);
|
||||
|
||||
Reference in New Issue
Block a user