Commit 06e55393 by fz

1.将手机蓝牙地址,自动感应状态分离出一张表

2.增加根据sn查询蓝牙地址接口
3.修改自动感应状态,添加手机蓝牙地址参数
1 parent 94f0de32
...@@ -20,6 +20,12 @@ public class AiLockingkeyController { ...@@ -20,6 +20,12 @@ public class AiLockingkeyController {
return aiLockingKeyService.getLockingKey(request); return aiLockingKeyService.getLockingKey(request);
} }
//sn查询车钥匙蓝牙地址
@GetMapping(value = "/bluemac/get")
public R getMobileBlueMac(SmartCarKeyRequest request) {
return aiLockingKeyService.getMobileBlueMac(request);
}
//userId查询车钥匙 //userId查询车钥匙
@GetMapping(value = "/user/getAll") @GetMapping(value = "/user/getAll")
public R getAllKeyByUser(SmartCarKeyUserRequest request) { public R getAllKeyByUser(SmartCarKeyUserRequest request) {
......
package com.glsx.smart.dao.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 智能车钥匙手机蓝牙感应状态表
*/
@Data
@Table(name = "smart_key_blue_sense")
public class SmartKeyBlueSense {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 自动感应状态 0:关,1:远,2:中,3:近
*/
private Integer autoSenseStatus;
/**
* 手机蓝牙的MAC地址
*/
private String mobileBlueMac;
/**
* 创建时间
*/
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
/**
* 智能车钥匙设备号
*/
private String sn;
/**
* 逻辑删除 0:正常 1:删除
*/
private Integer isDelete;
}
\ No newline at end of file \ No newline at end of file
package com.glsx.smart.dao.entity; package com.glsx.smart.dao.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/** /**
* 智能蓝牙车钥匙表 * 智能蓝牙车钥匙表
*/ */
@Data @Data
@Table(name = "smart_vehicle_blue_key") @Table(name = "smart_vehicle_blue_key")
public class SmartVehicleBlueKey implements Serializable { public class SmartVehicleBlueKey {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
...@@ -42,11 +40,6 @@ public class SmartVehicleBlueKey implements Serializable { ...@@ -42,11 +40,6 @@ public class SmartVehicleBlueKey implements Serializable {
private String secretKey; private String secretKey;
/** /**
* 手机蓝牙的MAC地址
*/
private String mobileBlueMac;
/**
* 智能车钥匙MAC地址 * 智能车钥匙MAC地址
*/ */
private String smartLockMac; private String smartLockMac;
...@@ -62,11 +55,6 @@ public class SmartVehicleBlueKey implements Serializable { ...@@ -62,11 +55,6 @@ public class SmartVehicleBlueKey implements Serializable {
private String keyName; private String keyName;
/** /**
* 自动感应状态 0:关 1:开
*/
private Integer autoSenseStatus;
/**
* 逻辑删除 0:正常 1:删除 * 逻辑删除 0:正常 1:删除
*/ */
private Integer isDelete; private Integer isDelete;
...@@ -85,4 +73,9 @@ public class SmartVehicleBlueKey implements Serializable { ...@@ -85,4 +73,9 @@ public class SmartVehicleBlueKey implements Serializable {
* 手机编号 * 手机编号
*/ */
private String mobileCode; private String mobileCode;
/**
* ios专用
*/
private String peripheralUuid;
} }
\ No newline at end of file \ No newline at end of file
...@@ -715,65 +715,6 @@ public class SmartVehicleBlueKeyExample { ...@@ -715,65 +715,6 @@ public class SmartVehicleBlueKeyExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andAutoSenseStatusIsNull() {
addCriterion("auto_sense_status is null");
return (Criteria) this;
}
public Criteria andAutoSenseStatusIsNotNull() {
addCriterion("auto_sense_status is not null");
return (Criteria) this;
}
public Criteria andAutoSenseStatusEqualTo(Integer value) {
addCriterion("auto_sense_status =", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusNotEqualTo(Integer value) {
addCriterion("auto_sense_status <>", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusGreaterThan(Integer value) {
addCriterion("auto_sense_status >", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("auto_sense_status >=", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusLessThan(Integer value) {
addCriterion("auto_sense_status <", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusLessThanOrEqualTo(Integer value) {
addCriterion("auto_sense_status <=", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusIn(List<Integer> values) {
addCriterion("auto_sense_status in", values, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusNotIn(List<Integer> values) {
addCriterion("auto_sense_status not in", values, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusBetween(Integer value1, Integer value2) {
addCriterion("auto_sense_status between", value1, value2, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusNotBetween(Integer value1, Integer value2) {
addCriterion("auto_sense_status not between", value1, value2, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andIsDeleteIsNull() { public Criteria andIsDeleteIsNull() {
addCriterion("is_delete is null"); addCriterion("is_delete is null");
...@@ -895,73 +836,74 @@ public class SmartVehicleBlueKeyExample { ...@@ -895,73 +836,74 @@ public class SmartVehicleBlueKeyExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeIsNull() {
addCriterion("mobile_code is null"); public Criteria andPeripheralUuidIsNull() {
addCriterion("peripheral_uuid is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeIsNotNull() { public Criteria andPeripheralUuidIsNotNull() {
addCriterion("mobile_code is not null"); addCriterion("peripheral_uuid is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeEqualTo(String value) { public Criteria andPeripheralUuidEqualTo(String value) {
addCriterion("mobile_code =", value, "mobileCode"); addCriterion("peripheral_uuid =", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeNotEqualTo(String value) { public Criteria andPeripheralUuidNotEqualTo(String value) {
addCriterion("mobile_code <>", value, "mobileCode"); addCriterion("peripheral_uuid <>", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeGreaterThan(String value) { public Criteria andPeripheralUuidGreaterThan(String value) {
addCriterion("mobile_code >", value, "mobileCode"); addCriterion("peripheral_uuid >", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeGreaterThanOrEqualTo(String value) { public Criteria andPeripheralUuidGreaterThanOrEqualTo(String value) {
addCriterion("mobile_code >=", value, "mobileCode"); addCriterion("peripheral_uuid >=", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeLessThan(String value) { public Criteria andPeripheralUuidLessThan(String value) {
addCriterion("mobile_code <", value, "mobileCode"); addCriterion("peripheral_uuid <", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeLessThanOrEqualTo(String value) { public Criteria andPeripheralUuidLessThanOrEqualTo(String value) {
addCriterion("mobile_code <=", value, "mobileCode"); addCriterion("peripheral_uuid <=", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeLike(String value) { public Criteria andPeripheralUuidLike(String value) {
addCriterion("mobile_code like", value, "mobileCode"); addCriterion("peripheral_uuid like", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeNotLike(String value) { public Criteria andPeripheralUuidNotLike(String value) {
addCriterion("mobile_code not like", value, "mobileCode"); addCriterion("peripheral_uuid not like", value, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeIn(List<String> values) { public Criteria andPeripheralUuidIn(List<String> values) {
addCriterion("mobile_code in", values, "mobileCode"); addCriterion("peripheral_uuid in", values, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeNotIn(List<String> values) { public Criteria andPeripheralUuidNotIn(List<String> values) {
addCriterion("mobile_code not in", values, "mobileCode"); addCriterion("peripheral_uuid not in", values, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeBetween(String value1, String value2) { public Criteria andPeripheralUuidBetween(String value1, String value2) {
addCriterion("mobile_code between", value1, value2, "mobileCode"); addCriterion("peripheral_uuid between", value1, value2, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeNotBetween(String value1, String value2) { public Criteria andPeripheralUuidNotBetween(String value1, String value2) {
addCriterion("mobile_code not between", value1, value2, "mobileCode"); addCriterion("peripheral_uuid not between", value1, value2, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
} }
......
package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartKeyBlueSense;
import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SmartKeyBlueSenseMapper {
long countByExample(SmartKeyBlueSenseExample example);
int deleteByExample(SmartKeyBlueSenseExample example);
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(Long id);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(SmartKeyBlueSense record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(SmartKeyBlueSense record);
List<SmartKeyBlueSense> selectByExample(SmartKeyBlueSenseExample example);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
SmartKeyBlueSense selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SmartKeyBlueSense record, @Param("example") SmartKeyBlueSenseExample example);
int updateByExample(@Param("record") SmartKeyBlueSense record, @Param("example") SmartKeyBlueSenseExample example);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(SmartKeyBlueSense record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(SmartKeyBlueSense record);
}
\ No newline at end of file \ No newline at end of file
...@@ -2,32 +2,68 @@ package com.glsx.smart.dao.mapper; ...@@ -2,32 +2,68 @@ package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartVehicleBlueKey; import com.glsx.smart.dao.entity.SmartVehicleBlueKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample; import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface SmartVehicleBlueKeyMapper { public interface SmartVehicleBlueKeyMapper {
long countByExample(SmartVehicleBlueKeyExample example); long countByExample(SmartVehicleBlueKeyExample example);
int deleteByExample(SmartVehicleBlueKeyExample example); int deleteByExample(SmartVehicleBlueKeyExample example);
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(SmartVehicleBlueKey record); int insert(SmartVehicleBlueKey record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(SmartVehicleBlueKey record); int insertSelective(SmartVehicleBlueKey record);
List<SmartVehicleBlueKey> selectByExample(SmartVehicleBlueKeyExample example); List<SmartVehicleBlueKey> selectByExample(SmartVehicleBlueKeyExample example);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
SmartVehicleBlueKey selectByPrimaryKey(Long id); SmartVehicleBlueKey selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SmartVehicleBlueKey record, @Param("example") SmartVehicleBlueKeyExample example); int updateByExampleSelective(@Param("record") SmartVehicleBlueKey record, @Param("example") SmartVehicleBlueKeyExample example);
int updateByExample(@Param("record") SmartVehicleBlueKey record, @Param("example") SmartVehicleBlueKeyExample example); int updateByExample(@Param("record") SmartVehicleBlueKey record, @Param("example") SmartVehicleBlueKeyExample example);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(SmartVehicleBlueKey record); int updateByPrimaryKeySelective(SmartVehicleBlueKey record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(SmartVehicleBlueKey record); int updateByPrimaryKey(SmartVehicleBlueKey record);
} }
\ No newline at end of file \ No newline at end of file
...@@ -20,13 +20,17 @@ public enum ResultEnum { ...@@ -20,13 +20,17 @@ public enum ResultEnum {
PRODUCT_TYPE_NOT_FOUND(3001, "产品类型ID未找到"), PRODUCT_TYPE_NOT_FOUND(3001, "产品类型ID未找到"),
PRODUCT_TYPE_NAME_DUPLICATE(3002, "产品类型名称重复"), PRODUCT_TYPE_NAME_DUPLICATE(3002, "产品类型名称重复"),
ENCRYPT_EXCEP_1(1101, "crep加密异常,无法插入"), CAR_KEY_EXCEP_1(1101, "crep加密异常,无法新增"),
ENCRYPT_EXCEP_2(1102, "crep加密异常,无法返回钥匙信息"), CAR_KEY_EXCEP_2(1102, "智能车钥匙查询,crep/secret加密异常"),
ENCRYPT_EXCEP_3(1103, "crep加密异常,无法更新"), CAR_KEY_EXCEP_3(1109, "车钥匙注册成功数据保存,车钥匙不存在"),
ENCRYPT_EXCEP_4(1104, "车钥匙操作指令上报crep解密异常"), CAR_KEY_EXCEP_4(1104, "车钥匙操作指令上报crep解密异常"),
ENCRYPT_EXCEP_5(1105, "智能车钥匙注册成功后的数据保存crep/secret解密异常"), CAR_KEY_EXCEP_5(1105, "智能车钥匙注册成功数据保存,crep/secret解密异常"),
ENCRYPT_EXCEP_6(1106, "智能车钥匙secretKey_db解密异常"), CAR_KEY_EXCEP_6(1106, "智能车钥匙查询,secretKey解密异常"),
ENCRYPT_EXCEP_7(1107, "智能车钥匙secretKey加密异常"), CAR_KEY_EXCEP_7(1107, "智能车钥匙secretKey加密异常"),
CAR_KEY_EXCEP_8(1108, "智能车钥匙新增异常"),
CAR_KEY_EXCEP_9(1109, "智能车钥匙注册成功数据保存,自动感应新增异常"),
CAR_KEY_EXCEP_10(1110, "异常数据,无crep"),
CAR_KEY_EXCEP_11(1111, "自动感应新增异常"),
; ;
private final Integer code; private final Integer code;
......
...@@ -7,10 +7,13 @@ import lombok.Data; ...@@ -7,10 +7,13 @@ import lombok.Data;
*/ */
@Data @Data
public class SmartCarKeyAutoSenseRequest{ public class SmartCarKeyAutoSenseRequest{
//智能车钥匙自动感应状态 //智能车钥匙自动感应状态 0:关,1:远,2:中,3:近'
private String autoSenseStatus; private String autoSenseStatus;
private String sn; private String sn;
private String userId; private String userId;
//手机蓝牙的MAC地址
private String mobileMac;
} }
...@@ -23,4 +23,9 @@ public class SmartCarKeyRegisterRequest{ ...@@ -23,4 +23,9 @@ public class SmartCarKeyRegisterRequest{
private String mobileCode; private String mobileCode;
private String userId; private String userId;
/**
* ios专用
*/
private String peripheralUuid;
} }
...@@ -68,4 +68,9 @@ public class SmartCarKeyResponse implements Serializable { ...@@ -68,4 +68,9 @@ public class SmartCarKeyResponse implements Serializable {
* 手机蓝牙的MAC地址 * 手机蓝牙的MAC地址
*/ */
private String mobileBlueMac; private String mobileBlueMac;
/**
* ios专用
*/
private String peripheralUuid;
} }
...@@ -42,4 +42,6 @@ public interface AiLockingKeyService { ...@@ -42,4 +42,6 @@ public interface AiLockingKeyService {
R setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest autoSenseStatus); R setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest autoSenseStatus);
R getAllKeyByUser(SmartCarKeyUserRequest request); R getAllKeyByUser(SmartCarKeyUserRequest request);
R getMobileBlueMac(SmartCarKeyRequest request);
} }
package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import com.glsx.smart.dao.entity.SmartKeyBlueSense;
import java.util.List;
public interface SmartKeyBlueSenseService {
long countByExample(SmartKeyBlueSenseExample example);
int deleteByExample(SmartKeyBlueSenseExample example);
int deleteByPrimaryKey(Long id);
int insert(SmartKeyBlueSense record);
int insertSelective(SmartKeyBlueSense record);
List<SmartKeyBlueSense> selectByExample(SmartKeyBlueSenseExample example);
SmartKeyBlueSense selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartKeyBlueSense record, SmartKeyBlueSenseExample example);
int updateByExample(SmartKeyBlueSense record, SmartKeyBlueSenseExample example);
int updateByPrimaryKeySelective(SmartKeyBlueSense record);
int updateByPrimaryKey(SmartKeyBlueSense record);
}
...@@ -34,3 +34,5 @@ public interface SmartVehicleBlueKeyService { ...@@ -34,3 +34,5 @@ public interface SmartVehicleBlueKeyService {
package com.glsx.smart.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import com.glsx.smart.dao.entity.SmartKeyBlueSense;
import java.util.List;
import com.glsx.smart.dao.mapper.SmartKeyBlueSenseMapper;
import com.glsx.smart.service.SmartKeyBlueSenseService;
@Service
public class SmartKeyBlueSenseServiceImpl implements SmartKeyBlueSenseService {
@Resource
private SmartKeyBlueSenseMapper smartKeyBlueSenseMapper;
@Override
public long countByExample(SmartKeyBlueSenseExample example) {
return smartKeyBlueSenseMapper.countByExample(example);
}
@Override
public int deleteByExample(SmartKeyBlueSenseExample example) {
return smartKeyBlueSenseMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return smartKeyBlueSenseMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartKeyBlueSense record) {
return smartKeyBlueSenseMapper.insert(record);
}
@Override
public int insertSelective(SmartKeyBlueSense record) {
return smartKeyBlueSenseMapper.insertSelective(record);
}
@Override
public List<SmartKeyBlueSense> selectByExample(SmartKeyBlueSenseExample example) {
return smartKeyBlueSenseMapper.selectByExample(example);
}
@Override
public SmartKeyBlueSense selectByPrimaryKey(Long id) {
return smartKeyBlueSenseMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartKeyBlueSense record, SmartKeyBlueSenseExample example) {
return smartKeyBlueSenseMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartKeyBlueSense record, SmartKeyBlueSenseExample example) {
return smartKeyBlueSenseMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartKeyBlueSense record) {
return smartKeyBlueSenseMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(SmartKeyBlueSense record) {
return smartKeyBlueSenseMapper.updateByPrimaryKey(record);
}
}
...@@ -74,3 +74,5 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic ...@@ -74,3 +74,5 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!