@@ -2,10 +2,9 @@ package cn.com.taiji.iaw.api.vfj; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.core.model.comm.protocol.inss.vfj.*; | |||
import cn.com.taiji.core.model.comm.COSConstant; | |||
import cn.com.taiji.iaw.api.MyValidController; | |||
import cn.com.taiji.iaw.dto.vfj.VfjGetVehicleInfoClearRequestDTO; | |||
import cn.com.taiji.iaw.dto.vfj.VfjGetVehicleInfoClearResponseDTO; | |||
import cn.com.taiji.iaw.dto.vfj.*; | |||
import cn.com.taiji.iaw.manager.vfj.VfjManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
@@ -34,37 +33,49 @@ public class VfjController extends MyValidController { | |||
@ApiOperation(value = "升级类OBU") | |||
@PostMapping(value = "/apply4Upgrade") | |||
public ApiResponse<VfjApply4UpgradeResponse> apply4Upgrade(@Valid @RequestBody VfjApply4UpgradeRequest dto) throws ManagerException { | |||
VfjApply4UpgradeResponse res = vfjManager.handle(dto); | |||
public ApiResponse<VfjApply4UpgradeResponseDTO> apply4Upgrade(@Valid @RequestBody VfjApply4UpgradeRequestDTO dto) throws ManagerException { | |||
VfjApply4UpgradeResponseDTO res = vfjManager.handle(dto); | |||
return ApiResponse.of(res).setMessage("操作成功"); | |||
} | |||
@ApiOperation(value = "获取发行脚本指令") | |||
@PostMapping(value = "/getCommands") | |||
public ApiResponse<VfjGetCommandsResponse> getCommands(@Valid @RequestBody VfjGetCommandsRequest dto) throws ManagerException { | |||
VfjGetCommandsResponse res = vfjManager.handle(dto); | |||
public ApiResponse<VfjGetCommandsResponseDTO> getCommands(@Valid @RequestBody VfjGetCommandsRequestDTO dto) throws ManagerException { | |||
VfjGetCommandsResponseDTO res = vfjManager.handle(dto); | |||
return ApiResponse.of(res).setMessage("操作成功"); | |||
} | |||
@ApiOperation(value = "密钥置换") | |||
@PostMapping(value = "/exchangeKey") | |||
public ApiResponse<VfjExchangeKeyResponse> exchangeKey(@Valid @RequestBody VfjExchangeKeyRequest dto) throws ManagerException { | |||
VfjExchangeKeyResponse res = vfjManager.handle(dto); | |||
public ApiResponse<VfjExchangeKeyResponseDTO> exchangeKey(@Valid @RequestBody VfjExchangeKeyRequestDTO dto) throws ManagerException { | |||
VfjExchangeKeyResponseDTO res = vfjManager.handle(dto); | |||
return ApiResponse.of(res).setMessage("操作成功"); | |||
} | |||
@ApiOperation(value = "升级成功确认") | |||
@PostMapping(value = "/upgradeDone") | |||
public ApiResponse<VfjUpgradeDoneResponse> upgradeDone(@Valid @RequestBody VfjUpgradeDoneRequest dto) throws ManagerException { | |||
VfjUpgradeDoneResponse res = vfjManager.handle(dto); | |||
public ApiResponse<VfjUpgradeDoneResponseDTO> upgradeDone(@Valid @RequestBody VfjUpgradeDoneRequestDTO dto) throws ManagerException { | |||
VfjUpgradeDoneResponseDTO res = vfjManager.handle(dto); | |||
return ApiResponse.of(res).setMessage("操作成功"); | |||
} | |||
@ApiOperation(value = "外部认证指令") | |||
@PostMapping(value = "/extAuth4Iss") | |||
public ApiResponse<VfjExtAuth4IssResponse> extAuth4Iss(@Valid @RequestBody VfjExtAuth4IssRequest dto) throws ManagerException { | |||
VfjExtAuth4IssResponse res = vfjManager.handle(dto); | |||
public ApiResponse<VfjExtAuth4IssResponseDTO> extAuth4Iss(@Valid @RequestBody VfjExtAuth4IssRequestDTO dto) throws ManagerException { | |||
VfjExtAuth4IssResponseDTO res = vfjManager.handle(dto); | |||
return ApiResponse.of(res).setMessage("操作成功"); | |||
} | |||
@ApiOperation(value = "获取随机码") | |||
@PostMapping(value = "/randomCode") | |||
public ApiResponse<String> randomCode() throws ManagerException { | |||
return ApiResponse.of(COSConstant.HOME_DIRECTORY).setMessage("操作成功"); | |||
} | |||
@ApiOperation(value = "在线激活") | |||
@PostMapping(value = "/obuActive") | |||
public ApiResponse<VfjObuActiveResponseDTO> obuActive(@Valid @RequestBody VfjObuActiveRequestDTO dto) throws ManagerException { | |||
VfjObuActiveResponseDTO res = vfjManager.handle(dto); | |||
return ApiResponse.of(res).setMessage("操作成功"); | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
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; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjApply4UpgradeRequestDTO extends AbstractBizRequestDTO { | |||
private String obuMac; | |||
@NotBlank(message = "请指定obu合同序列号") | |||
@JsonProperty(value = "contractSN") | |||
private String contractSn; | |||
@NotBlank(message = "请指定obu晶片序列号") | |||
private String chipSn; | |||
@NotBlank(message = "请指定发行模式") | |||
private String issueMode; | |||
@NotBlank(message = "请指定发行类型") | |||
private String issueType; | |||
@NotBlank(message = "请指定卡版本号") | |||
private String cardVersion; | |||
@NotBlank(message = "请指定obu版本号") | |||
private String obuVersion; | |||
} |
@@ -0,0 +1,16 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjApply4UpgradeResponseDTO extends BaseModel { | |||
private String cardNo; | |||
private String obuSn; | |||
private String issueSerialNo; | |||
} |
@@ -0,0 +1,20 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjExchangeKeyRequestDTO extends AbstractBizRequestDTO { | |||
@NotBlank(message = "请指定订单号") | |||
private String issueSerialNo; | |||
@NotBlank(message = "请指定密钥类型") | |||
private String key; | |||
@NotBlank(message = "请指定随机数") | |||
private String random; | |||
} |
@@ -0,0 +1,13 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjExchangeKeyResponseDTO extends BaseModel { | |||
private String apdu; | |||
} |
@@ -0,0 +1,21 @@ | |||
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; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjExtAuth4IssRequestDTO extends AbstractBizRequestDTO { | |||
@NotBlank(message = "请指定密钥类型") | |||
private String keyType; | |||
@NotBlank(message = "请指定随机数") | |||
private String random; | |||
@NotBlank(message = "请指定订单号") | |||
private String issueSerialNo; | |||
} |
@@ -0,0 +1,13 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjExtAuth4IssResponseDTO extends BaseModel { | |||
private String apdu; | |||
} |
@@ -0,0 +1,21 @@ | |||
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; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjGetCommandsRequestDTO extends AbstractBizRequestDTO { | |||
@NotBlank(message = "请指定卡片序列号") | |||
private String cardNo; | |||
@NotBlank(message = "请指定obu物料代码") | |||
private String wareId; | |||
@NotBlank(message = "请指定发行订单") | |||
private String issueSerialNo; | |||
} |
@@ -0,0 +1,13 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjGetCommandsResponseDTO extends BaseModel { | |||
private String commands; | |||
} |
@@ -1,6 +1,6 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -11,7 +11,7 @@ import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjGetVehicleInfoClearRequestDTO extends BaseModel { | |||
public class VfjGetVehicleInfoClearRequestDTO extends AbstractBizRequestDTO { | |||
@NotBlank(message = "请指定OBU合同序列号") | |||
@JsonProperty(value = "contractSN") | |||
private String contractSn;// OBU合同序列号 |
@@ -0,0 +1,25 @@ | |||
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; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@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 random;// 随机数 | |||
} |
@@ -0,0 +1,14 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjObuActiveResponseDTO extends BaseModel { | |||
private String apdu;// 修改文件或置换密钥的指令 | |||
private String orderNo;// 订单号 | |||
} |
@@ -0,0 +1,18 @@ | |||
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; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjUpgradeDoneRequestDTO extends AbstractBizRequestDTO { | |||
private String batchNo; | |||
@NotBlank(message = "请指定发行订单号") | |||
private String issueSerialNo; | |||
} |
@@ -0,0 +1,12 @@ | |||
package cn.com.taiji.iaw.dto.vfj; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class VfjUpgradeDoneResponseDTO extends BaseModel { | |||
} |
@@ -1,21 +1,21 @@ | |||
package cn.com.taiji.iaw.manager.vfj; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.core.model.comm.protocol.inss.vfj.*; | |||
import cn.com.taiji.iaw.dto.vfj.VfjGetVehicleInfoClearRequestDTO; | |||
import cn.com.taiji.iaw.dto.vfj.VfjGetVehicleInfoClearResponseDTO; | |||
import cn.com.taiji.iaw.dto.vfj.*; | |||
public interface VfjManager { | |||
VfjGetVehicleInfoClearResponseDTO handle(VfjGetVehicleInfoClearRequestDTO dto) throws ManagerException; | |||
VfjApply4UpgradeResponse handle(VfjApply4UpgradeRequest dto) throws ManagerException; | |||
VfjApply4UpgradeResponseDTO handle(VfjApply4UpgradeRequestDTO dto) throws ManagerException; | |||
VfjGetCommandsResponse handle(VfjGetCommandsRequest dto) throws ManagerException; | |||
VfjGetCommandsResponseDTO handle(VfjGetCommandsRequestDTO dto) throws ManagerException; | |||
VfjExchangeKeyResponse handle(VfjExchangeKeyRequest dto) throws ManagerException; | |||
VfjExchangeKeyResponseDTO handle(VfjExchangeKeyRequestDTO dto) throws ManagerException; | |||
VfjUpgradeDoneResponse handle(VfjUpgradeDoneRequest dto) throws ManagerException; | |||
VfjUpgradeDoneResponseDTO handle(VfjUpgradeDoneRequestDTO dto) throws ManagerException; | |||
VfjExtAuth4IssResponse handle(VfjExtAuth4IssRequest dto) throws ManagerException; | |||
VfjExtAuth4IssResponseDTO handle(VfjExtAuth4IssRequestDTO dto) throws ManagerException; | |||
VfjObuActiveResponseDTO handle(VfjObuActiveRequestDTO dto) throws ManagerException; | |||
} |
@@ -2,8 +2,7 @@ package cn.com.taiji.iaw.manager.vfj; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.core.model.comm.protocol.inss.vfj.*; | |||
import cn.com.taiji.iaw.dto.vfj.VfjGetVehicleInfoClearRequestDTO; | |||
import cn.com.taiji.iaw.dto.vfj.VfjGetVehicleInfoClearResponseDTO; | |||
import cn.com.taiji.iaw.dto.vfj.*; | |||
import cn.com.taiji.iaw.manager.AbstractCommManager; | |||
import org.springframework.stereotype.Service; | |||
@@ -21,27 +20,63 @@ public class VfjManagerImpl extends AbstractCommManager implements VfjManager { | |||
} | |||
@Override | |||
public VfjApply4UpgradeResponse handle(VfjApply4UpgradeRequest dto) throws ManagerException { | |||
return jsonPostRepeat(dto); | |||
public VfjApply4UpgradeResponseDTO handle(VfjApply4UpgradeRequestDTO dto) throws ManagerException { | |||
VfjApply4UpgradeRequest request = new VfjApply4UpgradeRequest(); | |||
copyProperties(dto, request); | |||
VfjApply4UpgradeResponse response = jsonPostRepeat(request); | |||
VfjApply4UpgradeResponseDTO resDto = new VfjApply4UpgradeResponseDTO(); | |||
copyProperties(response, resDto); | |||
return resDto; | |||
} | |||
@Override | |||
public VfjGetCommandsResponse handle(VfjGetCommandsRequest dto) throws ManagerException { | |||
return jsonPostRepeat(dto); | |||
public VfjGetCommandsResponseDTO handle(VfjGetCommandsRequestDTO dto) throws ManagerException { | |||
VfjGetCommandsRequest request = new VfjGetCommandsRequest(); | |||
copyProperties(dto, request); | |||
VfjGetCommandsResponse response = jsonPostRepeat(request); | |||
VfjGetCommandsResponseDTO resDto = new VfjGetCommandsResponseDTO(); | |||
copyProperties(response, resDto); | |||
return resDto; | |||
} | |||
@Override | |||
public VfjExchangeKeyResponseDTO handle(VfjExchangeKeyRequestDTO dto) throws ManagerException { | |||
VfjExchangeKeyRequest request = new VfjExchangeKeyRequest(); | |||
copyProperties(dto, request); | |||
VfjExchangeKeyResponse response = jsonPostRepeat(request); | |||
VfjExchangeKeyResponseDTO resDto = new VfjExchangeKeyResponseDTO(); | |||
copyProperties(response, resDto); | |||
return resDto; | |||
} | |||
@Override | |||
public VfjExchangeKeyResponse handle(VfjExchangeKeyRequest dto) throws ManagerException { | |||
return jsonPostRepeat(dto); | |||
public VfjUpgradeDoneResponseDTO handle(VfjUpgradeDoneRequestDTO dto) throws ManagerException { | |||
VfjUpgradeDoneRequest request = new VfjUpgradeDoneRequest(); | |||
copyProperties(dto, request); | |||
VfjUpgradeDoneResponse response = jsonPostRepeat(request); | |||
VfjUpgradeDoneResponseDTO resDto = new VfjUpgradeDoneResponseDTO(); | |||
copyProperties(response, resDto); | |||
return resDto; | |||
} | |||
@Override | |||
public VfjUpgradeDoneResponse handle(VfjUpgradeDoneRequest dto) throws ManagerException { | |||
return jsonPostRepeat(dto); | |||
public VfjExtAuth4IssResponseDTO handle(VfjExtAuth4IssRequestDTO dto) throws ManagerException { | |||
VfjExtAuth4IssRequest request = new VfjExtAuth4IssRequest(); | |||
copyProperties(dto, request); | |||
VfjExtAuth4IssResponse response = jsonPostRepeat(request); | |||
VfjExtAuth4IssResponseDTO resDto = new VfjExtAuth4IssResponseDTO(); | |||
copyProperties(response, resDto); | |||
return resDto; | |||
} | |||
@Override | |||
public VfjExtAuth4IssResponse handle(VfjExtAuth4IssRequest dto) throws ManagerException { | |||
return jsonPostRepeat(dto); | |||
public VfjObuActiveResponseDTO handle(VfjObuActiveRequestDTO dto) throws ManagerException { | |||
VfjObuActiveRequest request = new VfjObuActiveRequest(); | |||
copyProperties(dto, request); | |||
VfjObuActiveResponse response = jsonPostRepeat(request); | |||
VfjObuActiveResponseDTO resDto = new VfjObuActiveResponseDTO(); | |||
copyProperties(response, resDto); | |||
return resDto; | |||
} | |||
} |