Bläddra i källkod

提交获取指令功能

master
梁超 1 månad sedan
förälder
incheckning
5e33caaaae

+ 2
- 0
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/basic/QtkObuInfoRepo.java Visa fil

@@ -18,4 +18,6 @@ public interface QtkObuInfoRepo extends AbstractJpaRepo<QtkObuInfo, String>{

@Query("select obuId from QtkObuInfo where vehicleId = ?1 ")
List<String> queryByVehicleId(String vehicleId);

QtkObuInfo findByVehicleIdAndObuStatus(String vehicleId, ObuStatus obuStatus);
}

+ 6
- 9
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/vfj/VfjObuActiveRequestDTO.java Visa fil

@@ -1,7 +1,6 @@
package cn.com.taiji.iaw.dto.vfj;

import cn.com.taiji.core.dto.AbstractBizRequestDTO;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@@ -12,14 +11,12 @@ import javax.validation.constraints.NotBlank;
@Setter
@Accessors(chain = true)
public class VfjObuActiveRequestDTO extends AbstractBizRequestDTO {

@NotBlank(message = "请指定OBU合同序列号")
@JsonProperty(value = "contractSN")
private String contractSn;// OBU合同序列号

@NotBlank(message = "请指定系统信息文件")
private String flag;// 系统信息文件. 激活位

@NotBlank(message = "请指定卡号")
private String cardId;
@NotBlank(message = "请指定OBU编号")
private String obuId;//
@NotBlank(message = "请指定车牌号号")
private String vehicleId;// 车牌号
@NotBlank(message = "请指定随机数")
private String random;// 随机数
}

+ 0
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/vfj/VfjObuActiveResponseDTO.java Visa fil

@@ -10,5 +10,4 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class VfjObuActiveResponseDTO extends BaseModel {
private String apdu;// 修改文件或置换密钥的指令
private String orderNo;// 订单号
}

+ 22
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/vfj/VfjManagerImpl.java Visa fil

@@ -1,13 +1,24 @@
package cn.com.taiji.iaw.manager.vfj;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.core.entity.basic.QtkCardInfo;
import cn.com.taiji.core.entity.basic.QtkObuInfo;
import cn.com.taiji.core.entity.dict.basic.CardStatus;
import cn.com.taiji.core.entity.dict.basic.ObuStatus;
import cn.com.taiji.core.model.comm.protocol.inss.vfj.*;
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkObuInfoRepo;
import cn.com.taiji.iaw.dto.vfj.*;
import cn.com.taiji.iaw.manager.AbstractCommManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class VfjManagerImpl extends AbstractCommManager implements VfjManager {
@Autowired
private QtkCardInfoRepo qtkCardInfoRepo;
@Autowired
private QtkObuInfoRepo qtkObuInfoRepo;

@Override
public VfjGetVehicleInfoClearResponseDTO handle(VfjGetVehicleInfoClearRequestDTO dto) throws ManagerException {
@@ -71,8 +82,18 @@ public class VfjManagerImpl extends AbstractCommManager implements VfjManager {

@Override
public VfjObuActiveResponseDTO handle(VfjObuActiveRequestDTO dto) throws ManagerException {
QtkCardInfo cardInfo = qtkCardInfoRepo.findByVehicleIdAndCardStatus(dto.getVehicleId(), CardStatus.ZC);
if (cardInfo == null) throw new ManagerException("不存在正常状态的卡");
if (!dto.getCardId().equals(cardInfo.getCardId()))
throw new ManagerException("设备中的卡号与车辆关联的卡号不一致");
QtkObuInfo obuInfo = qtkObuInfoRepo.findByVehicleIdAndObuStatus(dto.getVehicleId(), ObuStatus.ZC);
if (obuInfo == null) throw new ManagerException("不存在正常状态的OBU");
if (!dto.getObuId().equals(obuInfo.getObuId()))
throw new ManagerException("设备中的OBU编号与车辆关联的OBU编号不一致");
VfjObuActiveRequest request = new VfjObuActiveRequest();
copyProperties(dto, request);
request.setFlag("0001");
request.setContractSn(dto.getObuId());
request.setRandom(dto.getRandom());
VfjObuActiveResponse response = jsonPostRepeat(request);
VfjObuActiveResponseDTO resDto = new VfjObuActiveResponseDTO();
copyProperties(response, resDto);

Laddar…
Avbryt
Spara