@@ -0,0 +1,128 @@ | |||
package cn.com.taiji.core.entity.managew; | |||
import java.time.LocalDateTime; | |||
import javax.persistence.*; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.basic.CardType; | |||
import cn.com.taiji.core.entity.dict.basic.DeviceVersion; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/** | |||
* 设备查询记录 | |||
* @author : qiubh | |||
* @date : 2025-04-30 | |||
*/ | |||
@Getter | |||
@Setter | |||
@Entity | |||
@Table(name = "MANAGEW_DEVICE_QUERY_RECORD") | |||
public class DeviceQueryRecord extends StringPropertyUUIDEntity { | |||
@NotNull | |||
@Column(name = "OPEN_ID") | |||
private String openId;//openId | |||
@NotNull | |||
@Column(name = "QUERY_TIME") | |||
private LocalDateTime queryTime;//查询时间; | |||
@NotNull | |||
@Column(name = "SOURCE_TYPE") | |||
@Enumerated(EnumType.STRING) | |||
private SourceType sourceType;//来源 | |||
// 卡信息 | |||
@NotBlank | |||
@Size(max = 20) | |||
@Column(name = "CARD_ID") | |||
private String cardId;//卡号; | |||
@NotBlank | |||
@Column(name = "CUSTOMER_NAME") | |||
private String customerName;// 用户姓名 | |||
@NotBlank | |||
@Column(name = "CUSTOMER_IDNUM") | |||
private String customerIdNum;// 身份证号 | |||
@NotBlank | |||
@Column(name = "CARD_VEHICLE_TYPE") | |||
private String cardVehicleType;// 行驶证车辆类型 | |||
@NotBlank | |||
@Column(name = "CARD_VEHICLE_PLATE") | |||
private String cardVehiclePlate;// 车牌号码 | |||
@NotNull | |||
@Column(name = "CARD_VEHICLE_PLATE_COLOR") | |||
private Integer vehiclePlateColor;// 车牌颜色 | |||
@NotNull | |||
@Column(name = "CARD_ENABLE_TIME") | |||
private LocalDateTime cardEnableTime;//卡启用时间; | |||
@NotNull | |||
@Column(name = "CARD_EXPIRE_TIME") | |||
private LocalDateTime cardExpireTime;//卡过期时间; | |||
@NotBlank | |||
@Column(name = "CHECK_SUMS") | |||
private String checksums;// 校验值 | |||
@NotBlank | |||
@Column(name = "CARD_VERSION") | |||
private String cardVersion;//卡版本号; | |||
@NotBlank | |||
@Column(name = "BINDING_FINISH_STATUS") | |||
private String bindingFinishStatus;//卡签绑定完成状态; | |||
// 签信息 | |||
@NotBlank | |||
@Size(max = 16) | |||
@Column(name = "OBU_ID") | |||
private String obuId;//obu编号; | |||
@NotBlank | |||
@Column(name = "OBU_VEHICLE_TYPE") | |||
private String obuVehicleType;//行驶证车辆类型 | |||
@NotNull | |||
@Column(name = "OBU_VEHICLE_CUSTOMER_TYPE") | |||
private Integer obuVehicleCustomerType;// 车辆用户类型不能为空 | |||
@NotBlank | |||
@Column(name = "OBU_VEHICLE_PLATE") | |||
private String obuVehiclePlate;// 车牌号码 | |||
@NotNull | |||
@Column(name = "OBU_VEHICLE_PLATE_COLOR") | |||
private Integer obuVehiclePlateColor;// 车牌颜色 | |||
@NotNull | |||
@Column(name = "APPROVED_COUNT") | |||
private Integer approvedCount;// 核定载人数 | |||
@NotBlank | |||
@Column(name = "VIN") | |||
private String vin;// 车辆识别代号 | |||
@NotBlank | |||
@Column(name = "VEHICLE_ENGINE_NUM") | |||
private String vehicleEngineNum;// 发动机号码 | |||
@NotNull | |||
@Column(name = "WHEEL_COUNT") | |||
private Integer wheelCount;// 车轮数 | |||
@NotNull | |||
@Column(name = "AXLE_COUNT") | |||
private Integer axleCount;// 车轴数 | |||
@NotNull | |||
@Column(name = "AXLE_DISTANCE") | |||
private Integer axleDistance; // 轴距 | |||
@NotBlank | |||
@Column(name = "VEHICLE_DIMENSIONS") | |||
private String vehicleDimensions;// 外廓尺寸 | |||
@NotNull | |||
@Column(name = "OBU_ENABLE_TIME") | |||
private LocalDateTime obuEnableTime;//启用时间; | |||
@NotNull | |||
@Column(name = "OBU_EXPIRE_TIME") | |||
private LocalDateTime obuExpireTime;//到期时间; | |||
@NotNull | |||
@Column(name = "IS_ACTIVE") | |||
private Boolean isActive;// 是否激活 | |||
@NotNull | |||
@Column(name = "LOAD_STATUS") | |||
private Boolean loadStatus; // 拆卸状态 | |||
@NotBlank | |||
@Column(name = "OBU_VERSION") | |||
private String obuVersion;// obu版本号; | |||
} |
@@ -0,0 +1,8 @@ | |||
package cn.com.taiji.core.repo.jpa.managew; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.managew.DeviceQueryRecord; | |||
public interface DeviceQueryRecordRepo extends AbstractJpaRepo<DeviceQueryRecord, String> { | |||
} |
@@ -0,0 +1,36 @@ | |||
package cn.com.taiji.iaw.api.ass; | |||
import javax.validation.Valid; | |||
import cn.com.taiji.iaw.dto.ass.AssDeviceQueryRecordRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.AssDeviceQueryRecordResponseDTO; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.iaw.api.MyValidController; | |||
import cn.com.taiji.iaw.dto.ass.AssSaveRecordRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.AssSaveRecordResponseDTO; | |||
import cn.com.taiji.iaw.manager.ass.DeviceQueryRecordManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
@Api(tags = {"设备查询记录"}) | |||
@RestController | |||
@RequestMapping("/deviceQueryRecord") | |||
public class DeviceQueryRecordController extends MyValidController { | |||
@Autowired | |||
private DeviceQueryRecordManager manager; | |||
@ApiOperation(value = "新增查询记录") | |||
@PostMapping(value = "/saveRecord") | |||
public ApiResponse<AssDeviceQueryRecordResponseDTO> saveRecord(@Valid @RequestBody AssDeviceQueryRecordRequestDTO reqDto) throws ManagerException { | |||
AssDeviceQueryRecordResponseDTO resDto = manager.saveRecord(reqDto); | |||
return ApiResponse.of(resDto).setMessage("添加成功"); | |||
} | |||
} |
@@ -0,0 +1,113 @@ | |||
package cn.com.taiji.iaw.dto.ass; | |||
import javax.persistence.Column; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import org.springframework.validation.annotation.Validated; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import java.time.LocalDateTime; | |||
@ApiModel(description = "设备查询记录新增") | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
@Validated | |||
public class AssDeviceQueryRecordRequestDTO extends AbstractBizRequestDTO { | |||
// 卡信息 | |||
@NotBlank | |||
@Size(max = 20) | |||
@ApiModelProperty(value = "卡号") | |||
private String cardId;//卡号; | |||
@NotBlank | |||
@ApiModelProperty(value = "用户姓名") | |||
private String customerName;// 用户姓名 | |||
@NotBlank | |||
@ApiModelProperty(value = "身份证号") | |||
private String customerIdNum;// 身份证号 | |||
@NotBlank | |||
@ApiModelProperty(value = "行驶证车辆类型") | |||
private String cardVehicleType;// 行驶证车辆类型 | |||
@NotBlank | |||
@ApiModelProperty(value = "车牌号码") | |||
private String cardVehiclePlate;// 车牌号码 | |||
@NotNull | |||
@ApiModelProperty(value = "车牌颜色") | |||
private Integer vehiclePlateColor;// 车牌颜色 | |||
@NotNull | |||
@ApiModelProperty(value = "卡启用时间") | |||
private LocalDateTime cardEnableTime;//卡启用时间; | |||
@NotNull | |||
@ApiModelProperty(value = "卡过期时间") | |||
private LocalDateTime cardExpireTime;//卡过期时间; | |||
@NotBlank | |||
@ApiModelProperty(value = "校验值") | |||
private String checksums;// 校验值 | |||
@NotBlank | |||
@ApiModelProperty(value = "卡版本号") | |||
private String cardVersion;//卡版本号; | |||
@NotBlank | |||
@ApiModelProperty(value = "卡签绑定完成状态") | |||
private String bindingFinishStatus;//卡签绑定完成状态; | |||
// 签信息 | |||
@NotBlank | |||
@Size(max = 16) | |||
@ApiModelProperty(value = "obu编号") | |||
private String obuId;//obu编号; | |||
@NotBlank | |||
@ApiModelProperty(value = "行驶证车辆类型") | |||
private String obuVehicleType;//行驶证车辆类型 | |||
@NotNull | |||
@ApiModelProperty(value = "车辆用户类型不能为空") | |||
private Integer obuVehicleCustomerType;// 车辆用户类型不能为空 | |||
@NotBlank | |||
@ApiModelProperty(value = "车牌号码") | |||
private String obuVehiclePlate;// 车牌号码 | |||
@NotNull | |||
@ApiModelProperty(value = "车牌颜色") | |||
private Integer obuVehiclePlateColor;// 车牌颜色 | |||
@NotNull | |||
@ApiModelProperty(value = "核定载人数") | |||
private Integer approvedCount;// 核定载人数 | |||
@NotBlank | |||
@ApiModelProperty(value = "车辆识别代号") | |||
private String vin;// 车辆识别代号 | |||
@NotBlank | |||
@ApiModelProperty(value = "发动机号码") | |||
private String vehicleEngineNum;// 发动机号码 | |||
@NotNull | |||
@ApiModelProperty(value = "车轮数") | |||
private Integer wheelCount;// 车轮数 | |||
@NotNull | |||
@ApiModelProperty(value = "车轴数") | |||
private Integer axleCount;// 车轴数 | |||
@NotNull | |||
@ApiModelProperty(value = "轴距") | |||
private Integer axleDistance; // 轴距 | |||
@NotBlank | |||
@ApiModelProperty(value = "外廓尺寸") | |||
private String vehicleDimensions;// 外廓尺寸 | |||
@NotNull | |||
@ApiModelProperty(value = "启用时间") | |||
private LocalDateTime obuEnableTime;//启用时间; | |||
@NotNull | |||
@ApiModelProperty(value = "到期时间") | |||
private LocalDateTime obuExpireTime;//到期时间; | |||
@NotNull | |||
@ApiModelProperty(value = "是否激活") | |||
private Boolean isActive;// 是否激活 | |||
@NotNull | |||
@ApiModelProperty(value = "拆卸状态") | |||
private Boolean loadStatus; // 拆卸状态 | |||
@NotBlank | |||
@ApiModelProperty(value = "obu版本号") | |||
private String obuVersion;// obu版本号; | |||
} |
@@ -0,0 +1,18 @@ | |||
package cn.com.taiji.iaw.dto.ass; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@ApiModel(description = "设备查询记录返回") | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class AssDeviceQueryRecordResponseDTO extends BaseModel { | |||
@ApiModelProperty(value = "id") | |||
private String id; | |||
} |
@@ -0,0 +1,12 @@ | |||
package cn.com.taiji.iaw.manager.ass; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.iaw.dto.ass.AssDeviceQueryRecordRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.AssDeviceQueryRecordResponseDTO; | |||
import cn.com.taiji.iaw.dto.ass.AssSaveRecordRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.AssSaveRecordResponseDTO; | |||
public interface DeviceQueryRecordManager { | |||
AssDeviceQueryRecordResponseDTO saveRecord(AssDeviceQueryRecordRequestDTO requestDTO) throws ServiceHandleException; | |||
} |
@@ -0,0 +1,42 @@ | |||
package cn.com.taiji.iaw.manager.ass; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.core.entity.managew.DeviceQueryRecord; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.core.repo.jpa.managew.DeviceQueryRecordRepo; | |||
import cn.com.taiji.iaw.dto.ass.AssDeviceQueryRecordRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.AssDeviceQueryRecordResponseDTO; | |||
import cn.com.taiji.iaw.manager.AbstractCommManager; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 设备查询记录相关功能 | |||
*/ | |||
@Service | |||
public class DeviceQueryRecordManagerImpl extends AbstractCommManager implements DeviceQueryRecordManager { | |||
@Autowired | |||
private DeviceQueryRecordRepo recordRepo; | |||
/** | |||
* 设备查询记录记录 | |||
*/ | |||
@Override | |||
@Transactional(rollbackFor = Exception.class) | |||
public AssDeviceQueryRecordResponseDTO saveRecord(AssDeviceQueryRecordRequestDTO requestDTO) throws ServiceHandleException { | |||
DeviceQueryRecord record = copyProperties(requestDTO, new DeviceQueryRecord()); | |||
record.setOpenId(findOpenIdByToken(requestDTO.getAccessToken())); | |||
record.setSourceType(requestDTO.getOrderSource()); | |||
record.setQueryTime(LocalDateTime.now()); | |||
recordRepo.save(record); | |||
AssDeviceQueryRecordResponseDTO resDTO = new AssDeviceQueryRecordResponseDTO(); | |||
resDTO.setId(record.getId()); | |||
return resDTO; | |||
} | |||
} |