Commit 265647a2 by fz

代码整理规范

1.优化车钥匙过期判断
1 parent d55cff92
Showing 27 changed files with 104 additions and 108 deletions
...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.controller; ...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.controller;
import cn.com.glsx.smart.modules.entity.SmartKeyBlueSense; import cn.com.glsx.smart.modules.entity.SmartKeyBlueSense;
import cn.com.glsx.smart.modules.entity.SmartVehicleBlueShareKey; import cn.com.glsx.smart.modules.entity.SmartVehicleBlueShareKey;
import cn.com.glsx.smart.modules.model.request.*; import cn.com.glsx.smart.modules.model.request.*;
import cn.com.glsx.smart.modules.model.response.SmartCarKeyResponse; import cn.com.glsx.smart.modules.model.response.CarKeyResponse;
import cn.com.glsx.smart.modules.service.AiLockingKeyService; import cn.com.glsx.smart.modules.service.AiLockingKeyService;
import cn.com.glsx.smart.modules.service.AiLockingKeyShareService; import cn.com.glsx.smart.modules.service.AiLockingKeyShareService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -37,7 +37,7 @@ public class AiLockingkeyController { ...@@ -37,7 +37,7 @@ public class AiLockingkeyController {
* 主车钥匙修改分享状态 * 主车钥匙修改分享状态
*/ */
@PostMapping(value = "/setPrimaryShareStatus") @PostMapping(value = "/setPrimaryShareStatus")
public R setPrimaryLockingKeyShareStatus(@RequestBody @Validated SmartKeyPrimaryShareEditReq request) { public R setPrimaryLockingKeyShareStatus(@RequestBody @Validated KeyPrimaryShareEditReq request) {
aiLockingKeyService.setPrimaryLockingKeyShareStatus(request); aiLockingKeyService.setPrimaryLockingKeyShareStatus(request);
return R.ok(); return R.ok();
} }
...@@ -68,7 +68,7 @@ public class AiLockingkeyController { ...@@ -68,7 +68,7 @@ public class AiLockingkeyController {
* 分享车钥匙设置修改分享状态 * 分享车钥匙设置修改分享状态
*/ */
@PostMapping(value = "/setShareStatus") @PostMapping(value = "/setShareStatus")
public R setShareLockingKeyShareStatus(@RequestBody @Validated SmartShareKeyDeleteRequest request) { public R setShareLockingKeyShareStatus(@RequestBody @Validated ShareKeyDeleteRequest request) {
String stopTime = aiLockingKeyShareService.removeShareKey(request); String stopTime = aiLockingKeyShareService.removeShareKey(request);
return R.ok().data(stopTime); return R.ok().data(stopTime);
} }
...@@ -80,7 +80,7 @@ public class AiLockingkeyController { ...@@ -80,7 +80,7 @@ public class AiLockingkeyController {
*/ */
@GetMapping(value = "/get") @GetMapping(value = "/get")
public R getLockingKey(@RequestParam("userId")String userId,@RequestParam("sn")String sn) { public R getLockingKey(@RequestParam("userId")String userId,@RequestParam("sn")String sn) {
SmartCarKeyResponse response = aiLockingKeyService.getLockingKey(userId,sn); CarKeyResponse response = aiLockingKeyService.getLockingKey(userId,sn);
return R.ok().data(response); return R.ok().data(response);
} }
...@@ -98,7 +98,7 @@ public class AiLockingkeyController { ...@@ -98,7 +98,7 @@ public class AiLockingkeyController {
*/ */
@GetMapping(value = "/user/getAll") @GetMapping(value = "/user/getAll")
public R getAllKeyByUser(@RequestParam("userId")String userId) { public R getAllKeyByUser(@RequestParam("userId")String userId) {
List<SmartCarKeyResponse> smartCarKeyResponses = aiLockingKeyService.getAllKeyByUser(userId); List<CarKeyResponse> smartCarKeyResponses = aiLockingKeyService.getAllKeyByUser(userId);
return R.ok().data(smartCarKeyResponses); return R.ok().data(smartCarKeyResponses);
} }
...@@ -106,7 +106,7 @@ public class AiLockingkeyController { ...@@ -106,7 +106,7 @@ public class AiLockingkeyController {
* 智能车钥匙解绑 * 智能车钥匙解绑
*/ */
@PostMapping(value = "/remove") @PostMapping(value = "/remove")
public R removeLockingKey(@RequestBody @Validated SmartCarKeyRequest request) { public R removeLockingKey(@RequestBody @Validated CarKeyRequest request) {
aiLockingKeyService.removeLockingKey(request); aiLockingKeyService.removeLockingKey(request);
return R.ok(); return R.ok();
} }
...@@ -115,7 +115,7 @@ public class AiLockingkeyController { ...@@ -115,7 +115,7 @@ public class AiLockingkeyController {
* 智能车钥匙注册成功后的数据保存 * 智能车钥匙注册成功后的数据保存
*/ */
@PostMapping(value = "/saveRegisterInfo") @PostMapping(value = "/saveRegisterInfo")
public R saveLockingKeyRegisterInfo(@RequestBody @Validated SmartCarKeyRegisterRequest request) { public R saveLockingKeyRegisterInfo(@RequestBody @Validated CarKeyRegisterRequest request) {
aiLockingKeyService.saveLockingKeyRegisterInfo(request); aiLockingKeyService.saveLockingKeyRegisterInfo(request);
return R.ok(); return R.ok();
} }
...@@ -124,7 +124,7 @@ public class AiLockingkeyController { ...@@ -124,7 +124,7 @@ public class AiLockingkeyController {
* 根据userid注销钥匙 * 根据userid注销钥匙
*/ */
@PostMapping(value = "/removeKeysByUser") @PostMapping(value = "/removeKeysByUser")
public R removeKeysByUser(@RequestBody @Validated SmartCarKeyUserRequest request) { public R removeKeysByUser(@RequestBody @Validated CarKeyUserRequest request) {
int count = aiLockingKeyService.removeKeysByUser(request); int count = aiLockingKeyService.removeKeysByUser(request);
return R.ok().data(count); return R.ok().data(count);
} }
...@@ -133,7 +133,7 @@ public class AiLockingkeyController { ...@@ -133,7 +133,7 @@ public class AiLockingkeyController {
* 车钥匙操作指令上报 * 车钥匙操作指令上报
*/ */
@PostMapping(value = "/logCommand") @PostMapping(value = "/logCommand")
public R LogLockingKeyCommand(@RequestBody @Validated SmartCarKeyCommandRequest request) { public R LogLockingKeyCommand(@RequestBody @Validated CarKeyCommandRequest request) {
aiLockingKeyService.LogLockingKeyCommand(request); aiLockingKeyService.LogLockingKeyCommand(request);
return R.ok(); return R.ok();
} }
...@@ -142,7 +142,7 @@ public class AiLockingkeyController { ...@@ -142,7 +142,7 @@ public class AiLockingkeyController {
* 车钥匙操作指令批量上报 * 车钥匙操作指令批量上报
*/ */
@PostMapping(value = "/batchLogCommand") @PostMapping(value = "/batchLogCommand")
public R batchLogCommand(@RequestBody @Validated SmartCarKeyActionLogBatchRequest request) { public R batchLogCommand(@RequestBody @Validated CarKeyActionLogBatchRequest request) {
int count = aiLockingKeyService.batchLogCommand(request); int count = aiLockingKeyService.batchLogCommand(request);
return R.ok().data(count); return R.ok().data(count);
} }
...@@ -151,7 +151,7 @@ public class AiLockingkeyController { ...@@ -151,7 +151,7 @@ public class AiLockingkeyController {
* 车钥匙修改昵称 * 车钥匙修改昵称
*/ */
@PostMapping(value = "/setName") @PostMapping(value = "/setName")
public R setLockingKeyName(@RequestBody @Validated SmartCarKeyNameRequest request) { public R setLockingKeyName(@RequestBody @Validated CarKeyNameRequest request) {
aiLockingKeyService.setLockingKeyName(request); aiLockingKeyService.setLockingKeyName(request);
return R.ok(); return R.ok();
} }
...@@ -160,7 +160,7 @@ public class AiLockingkeyController { ...@@ -160,7 +160,7 @@ public class AiLockingkeyController {
* 车钥匙修改自动感应 * 车钥匙修改自动感应
*/ */
@PostMapping(value = "/setAutoSense") @PostMapping(value = "/setAutoSense")
public R setLockingKeyAutoSense(@RequestBody @Validated SmartCarKeyAutoSenseRequest request) { public R setLockingKeyAutoSense(@RequestBody @Validated CarKeyAutoSenseRequest request) {
aiLockingKeyService.setLockingKeyAutoSense(request); aiLockingKeyService.setLockingKeyAutoSense(request);
return R.ok(); return R.ok();
} }
......
package cn.com.glsx.smart.modules.controller; package cn.com.glsx.smart.modules.controller;
import cn.com.glsx.smart.modules.entity.SmartShareKeyBlueKey; import cn.com.glsx.smart.modules.entity.SmartShareKeyBlueKey;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyReceiveRequest; import cn.com.glsx.smart.modules.model.request.CarKeyReceiveRequest;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareActionLogBatchRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogBatchRequest;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareLogRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogRequest;
import cn.com.glsx.smart.modules.model.request.SmartShareKeyDeleteRequest; import cn.com.glsx.smart.modules.model.request.ShareKeyDeleteRequest;
import cn.com.glsx.smart.modules.service.AiLockingKeyShareService; import cn.com.glsx.smart.modules.service.AiLockingKeyShareService;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -59,7 +59,7 @@ public class AiLockingkeyShareController { ...@@ -59,7 +59,7 @@ public class AiLockingkeyShareController {
* 领取钥匙接口 * 领取钥匙接口
*/ */
@PostMapping(value = "/receive") @PostMapping(value = "/receive")
public R receiveKey(@RequestBody @Validated SmartCarKeyReceiveRequest request) { public R receiveKey(@RequestBody @Validated CarKeyReceiveRequest request) {
aiLockingKeyShareService.receiveKey(request); aiLockingKeyShareService.receiveKey(request);
return R.ok("钥匙领用成功"); return R.ok("钥匙领用成功");
} }
...@@ -68,7 +68,7 @@ public class AiLockingkeyShareController { ...@@ -68,7 +68,7 @@ public class AiLockingkeyShareController {
* 分享钥匙的操作日志 * 分享钥匙的操作日志
*/ */
@PostMapping(value = "/logCommand") @PostMapping(value = "/logCommand")
public R logShareLockingKeyCommand(@RequestBody @Validated SmartCarKeyShareLogRequest request) { public R logShareLockingKeyCommand(@RequestBody @Validated CarKeyShareLogRequest request) {
aiLockingKeyShareService.logShareLockingKeyCommand(request); aiLockingKeyShareService.logShareLockingKeyCommand(request);
return R.ok(); return R.ok();
} }
...@@ -77,7 +77,7 @@ public class AiLockingkeyShareController { ...@@ -77,7 +77,7 @@ public class AiLockingkeyShareController {
* 车钥匙操作指令批量上报 * 车钥匙操作指令批量上报
*/ */
@PostMapping(value = "/batchLogCommand") @PostMapping(value = "/batchLogCommand")
public R batchLogCommand(@RequestBody @Validated SmartCarKeyShareActionLogBatchRequest request) { public R batchLogCommand(@RequestBody @Validated CarKeyShareLogBatchRequest request) {
int count = aiLockingKeyShareService.batchLogCommand(request); int count = aiLockingKeyShareService.batchLogCommand(request);
return R.ok().data(count); return R.ok().data(count);
} }
...@@ -95,7 +95,7 @@ public class AiLockingkeyShareController { ...@@ -95,7 +95,7 @@ public class AiLockingkeyShareController {
* 删除共享钥匙 * 删除共享钥匙
*/ */
@PostMapping(value = "/removeShareKey") @PostMapping(value = "/removeShareKey")
public R removeShareKey(@RequestBody @Validated SmartShareKeyDeleteRequest request) { public R removeShareKey(@RequestBody @Validated ShareKeyDeleteRequest request) {
String removeTime = aiLockingKeyShareService.removeShareKey(request); String removeTime = aiLockingKeyShareService.removeShareKey(request);
return R.ok().data(removeTime); return R.ok().data(removeTime);
} }
......
...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.mapper; ...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.mapper;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandLog; import cn.com.glsx.smart.modules.entity.SmartKeyCommandLog;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandLogExample; import cn.com.glsx.smart.modules.entity.SmartKeyCommandLogExample;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyCommandRequest; import cn.com.glsx.smart.modules.model.request.CarKeyCommandRequest;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -32,5 +32,5 @@ public interface SmartKeyCommandLogMapper { ...@@ -32,5 +32,5 @@ public interface SmartKeyCommandLogMapper {
int updateByPrimaryKey(SmartKeyCommandLog record); int updateByPrimaryKey(SmartKeyCommandLog record);
int insertBatch(@Param("lockingkeyActLogList") List<SmartCarKeyCommandRequest> lockingkeyActLogList); int insertBatch(@Param("lockingkeyActLogList") List<CarKeyCommandRequest> lockingkeyActLogList);
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.mapper; ...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.mapper;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLog; import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLog;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLogExample; import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLogExample;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareLogRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogRequest;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -62,5 +62,5 @@ public interface SmartKeyCommandShareLogMapper { ...@@ -62,5 +62,5 @@ public interface SmartKeyCommandShareLogMapper {
*/ */
int updateByPrimaryKey(SmartKeyCommandShareLog record); int updateByPrimaryKey(SmartKeyCommandShareLog record);
int insertBatch(@Param("lockingkeyActLogList") List<SmartCarKeyShareLogRequest> lockingkeyActLogList); int insertBatch(@Param("lockingkeyActLogList") List<CarKeyShareLogRequest> lockingkeyActLogList);
} }
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank; ...@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
* @createTime 2021年05月02日 09:59:00 * @createTime 2021年05月02日 09:59:00
*/ */
@Data @Data
public class SmartCarKeyActionLogBatchRequest extends SmartCarKeyUserRequest{ public class CarKeyActionLogBatchRequest extends CarKeyUserRequest {
/** /**
* 批量上报的日志 * 批量上报的日志
*/ */
......
...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank; ...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank;
* 智能车钥匙,自动感应状态 * 智能车钥匙,自动感应状态
*/ */
@Data @Data
public class SmartCarKeyAutoSenseRequest extends SmartCarKeyRequest{ public class CarKeyAutoSenseRequest extends CarKeyRequest {
/** /**
* 智能车钥匙自动感应状态 0:关 1:近 2:中 3:远' * 智能车钥匙自动感应状态 0:关 1:近 2:中 3:远'
*/ */
......
...@@ -3,6 +3,7 @@ package cn.com.glsx.smart.modules.model.request; ...@@ -3,6 +3,7 @@ package cn.com.glsx.smart.modules.model.request;
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.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
...@@ -11,7 +12,7 @@ import java.util.Date; ...@@ -11,7 +12,7 @@ import java.util.Date;
* 智能车钥匙,指令上报 * 智能车钥匙,指令上报
*/ */
@Data @Data
public class SmartCarKeyCommandRequest extends SmartCarKeyUserRequest{ public class CarKeyCommandRequest extends CarKeyUserRequest {
/** /**
* 平台生成的唯一CREP信息 * 平台生成的唯一CREP信息
*/ */
......
...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank; ...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank;
* 智能车钥匙,昵称 * 智能车钥匙,昵称
*/ */
@Data @Data
public class SmartCarKeyNameRequest extends SmartCarKeyRequest{ public class CarKeyNameRequest extends CarKeyRequest {
/** /**
* 钥匙昵称 * 钥匙昵称
*/ */
......
...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank; ...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank;
* 智能车钥匙领取 * 智能车钥匙领取
*/ */
@Data @Data
public class SmartCarKeyReceiveRequest extends SmartCarKeyUserRequest{ public class CarKeyReceiveRequest extends CarKeyUserRequest {
/** /**
* token令牌 * token令牌
*/ */
......
...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank; ...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank;
* 智能车钥匙,注册信息保存 * 智能车钥匙,注册信息保存
*/ */
@Data @Data
public class SmartCarKeyRegisterRequest extends SmartCarKeyUserRequest{ public class CarKeyRegisterRequest extends CarKeyUserRequest {
/** /**
* 手机蓝牙的MAC地址 * 手机蓝牙的MAC地址
*/ */
......
...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank; ...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank;
* 智能车钥匙,查询车钥匙和生成crep接口 * 智能车钥匙,查询车钥匙和生成crep接口
*/ */
@Data @Data
public class SmartCarKeyRequest extends SmartCarKeyUserRequest{ public class CarKeyRequest extends CarKeyUserRequest {
/** /**
* 设备号 * 设备号
*/ */
......
...@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank; ...@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
* @createTime 2021年05月02日 09:59:00 * @createTime 2021年05月02日 09:59:00
*/ */
@Data @Data
public class SmartCarKeyShareActionLogBatchRequest { public class CarKeyShareLogBatchRequest {
/** /**
* 批量上报的日志 * 批量上报的日志
*/ */
......
...@@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull; ...@@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
@Data @Data
public class SmartCarKeyShareLogRequest { public class CarKeyShareLogRequest {
/** /**
* 指令代码 * 指令代码
* 1、开锁;2、关锁;3、开尾门;4、寻车;5、自动感应近; * 1、开锁;2、关锁;3、开尾门;4、寻车;5、自动感应近;
......
package cn.com.glsx.smart.modules.model.request; package cn.com.glsx.smart.modules.model.request;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
* 智能车钥匙,指令上报 * 智能车钥匙,指令上报
*/ */
@Data @Data
public class SmartCarKeyUserRequest { public class CarKeyUserRequest {
/** /**
* 用户id * 用户id
*/ */
......
package cn.com.glsx.smart.modules.model.request; package cn.com.glsx.smart.modules.model.request;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
* 车钥匙修改分享状态接口 * 车钥匙修改分享状态接口
*/ */
@Data @Data
public class SmartKeyPrimaryShareEditReq extends SmartCarKeyRequest{ public class KeyPrimaryShareEditReq extends CarKeyRequest {
/** /**
* 分享状态 0:关闭 1:打开 * 分享状态 0:关闭 1:打开
* 默认打开 * 默认打开
......
package cn.com.glsx.smart.modules.model.request; package cn.com.glsx.smart.modules.model.request;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
* 智能车钥匙,解绑车钥匙接口 * 智能车钥匙,解绑车钥匙接口
*/ */
@Data @Data
public class SmartShareKeyDeleteRequest { public class ShareKeyDeleteRequest {
/** /**
* 分享钥匙主键id * 分享钥匙主键id
*/ */
......
...@@ -8,7 +8,7 @@ import java.io.Serializable; ...@@ -8,7 +8,7 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
@Data @Data
public class SmartCarKeyResponse implements Serializable { public class CarKeyResponse implements Serializable {
private Long id; private Long id;
/** /**
* 用户ID * 用户ID
......
...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.service; ...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.service;
import cn.com.glsx.smart.modules.entity.SmartKeyBlueSense; import cn.com.glsx.smart.modules.entity.SmartKeyBlueSense;
import cn.com.glsx.smart.modules.entity.SmartVehicleBlueShareKey; import cn.com.glsx.smart.modules.entity.SmartVehicleBlueShareKey;
import cn.com.glsx.smart.modules.model.request.*; import cn.com.glsx.smart.modules.model.request.*;
import cn.com.glsx.smart.modules.model.response.SmartCarKeyResponse; import cn.com.glsx.smart.modules.model.response.CarKeyResponse;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import java.util.List; import java.util.List;
...@@ -19,43 +19,43 @@ public interface AiLockingKeyService { ...@@ -19,43 +19,43 @@ public interface AiLockingKeyService {
/** /**
* 通过sn获取车钥匙 * 通过sn获取车钥匙
*/ */
SmartCarKeyResponse getLockingKey(String userId,String sn); CarKeyResponse getLockingKey(String userId, String sn);
/** /**
* 通过sn解绑车钥匙 * 通过sn解绑车钥匙
*/ */
void removeLockingKey(SmartCarKeyRequest request); void removeLockingKey(CarKeyRequest request);
/** /**
* 车钥匙注册信息保存 * 车钥匙注册信息保存
*/ */
void saveLockingKeyRegisterInfo(SmartCarKeyRegisterRequest registerSaveRequest); void saveLockingKeyRegisterInfo(CarKeyRegisterRequest registerSaveRequest);
/** /**
* 车钥匙指令上报 * 车钥匙指令上报
*/ */
void LogLockingKeyCommand(SmartCarKeyCommandRequest carKeyCommandRequest); void LogLockingKeyCommand(CarKeyCommandRequest carKeyCommandRequest);
/** /**
* 修改车钥匙昵称 * 修改车钥匙昵称
*/ */
void setLockingKeyName(SmartCarKeyNameRequest name); void setLockingKeyName(CarKeyNameRequest name);
/** /**
* 修改车钥匙自动感应状态 * 修改车钥匙自动感应状态
*/ */
void setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest autoSenseStatus); void setLockingKeyAutoSense(CarKeyAutoSenseRequest autoSenseStatus);
List<SmartCarKeyResponse> getAllKeyByUser(String request); List<CarKeyResponse> getAllKeyByUser(String request);
List<SmartKeyBlueSense> getMobileBlueMac(String userId,String sn); List<SmartKeyBlueSense> getMobileBlueMac(String userId,String sn);
int removeKeysByUser(SmartCarKeyUserRequest request); int removeKeysByUser(CarKeyUserRequest request);
void setPrimaryLockingKeyShareStatus(SmartKeyPrimaryShareEditReq request); void setPrimaryLockingKeyShareStatus(KeyPrimaryShareEditReq request);
int batchLogCommand(SmartCarKeyActionLogBatchRequest request); int batchLogCommand(CarKeyActionLogBatchRequest request);
String getShareToken(String userId, String sn, String expireTime); String getShareToken(String userId, String sn, String expireTime);
......
package cn.com.glsx.smart.modules.service; package cn.com.glsx.smart.modules.service;
import cn.com.glsx.smart.modules.entity.SmartShareKeyBlueKey; import cn.com.glsx.smart.modules.entity.SmartShareKeyBlueKey;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyReceiveRequest; import cn.com.glsx.smart.modules.model.request.CarKeyReceiveRequest;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareActionLogBatchRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogBatchRequest;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareLogRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogRequest;
import cn.com.glsx.smart.modules.model.request.SmartShareKeyDeleteRequest; import cn.com.glsx.smart.modules.model.request.ShareKeyDeleteRequest;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -13,11 +13,11 @@ public interface AiLockingKeyShareService { ...@@ -13,11 +13,11 @@ public interface AiLockingKeyShareService {
Map<String, Object> getShareKeyByToken(String token); Map<String, Object> getShareKeyByToken(String token);
void receiveKey(SmartCarKeyReceiveRequest request); void receiveKey(CarKeyReceiveRequest request);
void logShareLockingKeyCommand(SmartCarKeyShareLogRequest request); void logShareLockingKeyCommand(CarKeyShareLogRequest request);
String removeShareKey(SmartShareKeyDeleteRequest request); String removeShareKey(ShareKeyDeleteRequest request);
SmartShareKeyBlueKey getShareLockingKey(String keyId); SmartShareKeyBlueKey getShareLockingKey(String keyId);
...@@ -25,5 +25,5 @@ public interface AiLockingKeyShareService { ...@@ -25,5 +25,5 @@ public interface AiLockingKeyShareService {
List<SmartShareKeyBlueKey> getShareKeyListByUser(Long userId); List<SmartShareKeyBlueKey> getShareKeyListByUser(Long userId);
int batchLogCommand(SmartCarKeyShareActionLogBatchRequest request); int batchLogCommand(CarKeyShareLogBatchRequest request);
} }
...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.service; ...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.service;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandLog; import cn.com.glsx.smart.modules.entity.SmartKeyCommandLog;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandLogExample; import cn.com.glsx.smart.modules.entity.SmartKeyCommandLogExample;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyCommandRequest; import cn.com.glsx.smart.modules.model.request.CarKeyCommandRequest;
import java.util.List; import java.util.List;
...@@ -31,7 +31,7 @@ public interface SmartKeyCommandLogService { ...@@ -31,7 +31,7 @@ public interface SmartKeyCommandLogService {
int updateByPrimaryKey(SmartKeyCommandLog record); int updateByPrimaryKey(SmartKeyCommandLog record);
int insertBatch(List<SmartCarKeyCommandRequest> lockingkeyActLogList); int insertBatch(List<CarKeyCommandRequest> lockingkeyActLogList);
} }
......
...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.service; ...@@ -2,7 +2,7 @@ package cn.com.glsx.smart.modules.service;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLog; import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLog;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLogExample; import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLogExample;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareLogRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogRequest;
import java.util.List; import java.util.List;
...@@ -31,5 +31,5 @@ public interface SmartKeyCommandShareLogService{ ...@@ -31,5 +31,5 @@ public interface SmartKeyCommandShareLogService{
int updateByPrimaryKey(SmartKeyCommandShareLog record); int updateByPrimaryKey(SmartKeyCommandShareLog record);
int insertBatch(List<SmartCarKeyShareLogRequest> lockingkeyActLogList); int insertBatch(List<CarKeyShareLogRequest> lockingkeyActLogList);
} }
...@@ -7,7 +7,7 @@ import cn.com.glsx.smart.common.utils.JwtUtil; ...@@ -7,7 +7,7 @@ import cn.com.glsx.smart.common.utils.JwtUtil;
import cn.com.glsx.smart.common.utils.SnowflakeWorker; import cn.com.glsx.smart.common.utils.SnowflakeWorker;
import cn.com.glsx.smart.modules.entity.*; import cn.com.glsx.smart.modules.entity.*;
import cn.com.glsx.smart.modules.model.request.*; import cn.com.glsx.smart.modules.model.request.*;
import cn.com.glsx.smart.modules.model.response.SmartCarKeyResponse; import cn.com.glsx.smart.modules.model.response.CarKeyResponse;
import cn.com.glsx.smart.modules.service.*; import cn.com.glsx.smart.modules.service.*;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -33,7 +33,6 @@ import java.util.stream.Collectors; ...@@ -33,7 +33,6 @@ import java.util.stream.Collectors;
* @author fengzhi * @author fengzhi
* @date 2021-04-19 * @date 2021-04-19
*/ */
//TODO R.Error处理
@Service @Service
@Slf4j @Slf4j
public class AiLockingKeyServiceImpl implements AiLockingKeyService { public class AiLockingKeyServiceImpl implements AiLockingKeyService {
...@@ -63,8 +62,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -63,8 +62,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
*/ */
@Override @Override
public SmartCarKeyResponse getLockingKey(String userId,String sn) { public CarKeyResponse getLockingKey(String userId, String sn) {
SmartCarKeyResponse response = new SmartCarKeyResponse(); CarKeyResponse response = new CarKeyResponse();
//根据sn查询车钥匙 //根据sn查询车钥匙
SmartVehicleBlueKey carkey = smartVehicleBlueKeyService.selectByUserAndSn(Long.valueOf(userId), sn); SmartVehicleBlueKey carkey = smartVehicleBlueKeyService.selectByUserAndSn(Long.valueOf(userId), sn);
...@@ -102,7 +101,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -102,7 +101,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
* 智能车钥匙解绑 * 智能车钥匙解绑
*/ */
@Override @Override
public void removeLockingKey(SmartCarKeyRequest request) { public void removeLockingKey(CarKeyRequest request) {
//根据userid,sn查询主钥匙 //根据userid,sn查询主钥匙
SmartVehicleBlueKey blueKey = smartVehicleBlueKeyService.selectByUserAndSnNotNull(request.getUserId(), request.getSn()); SmartVehicleBlueKey blueKey = smartVehicleBlueKeyService.selectByUserAndSnNotNull(request.getUserId(), request.getSn());
...@@ -118,7 +117,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -118,7 +117,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
} }
//private SmartVehicleBlueKey getCarKey(SmartCarKeyRequest request) { //private SmartVehicleBlueKey getCarKey(CarKeyRequest request) {
// SmartVehicleBlueKeyExample example = smartVehicleBlueKeyService.getBlueKeyExampleByUserAndSn(Long.valueOf(request.getUserId()), request.getSn()); // SmartVehicleBlueKeyExample example = smartVehicleBlueKeyService.getBlueKeyExampleByUserAndSn(Long.valueOf(request.getUserId()), request.getSn());
// List<SmartVehicleBlueKey> keyList = smartVehicleBlueKeyService.selectByExample(example); // List<SmartVehicleBlueKey> keyList = smartVehicleBlueKeyService.selectByExample(example);
// //
...@@ -134,7 +133,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -134,7 +133,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
* 根据userid注销 * 根据userid注销
*/ */
@Override @Override
public int removeKeysByUser(SmartCarKeyUserRequest request) { public int removeKeysByUser(CarKeyUserRequest request) {
int count = 0; int count = 0;
long userId = request.getUserId(); long userId = request.getUserId();
...@@ -166,7 +165,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -166,7 +165,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
* 车钥匙操作指令上报 * 车钥匙操作指令上报
*/ */
@Override @Override
public void LogLockingKeyCommand(SmartCarKeyCommandRequest carKeyCommandRequest) { public void LogLockingKeyCommand(CarKeyCommandRequest carKeyCommandRequest) {
SmartKeyCommandLog logData = new SmartKeyCommandLog(); SmartKeyCommandLog logData = new SmartKeyCommandLog();
logData.setUserId(Long.valueOf(carKeyCommandRequest.getUserId())); logData.setUserId(Long.valueOf(carKeyCommandRequest.getUserId()));
String crep = aesEncryptUtils.decrypt(carKeyCommandRequest.getCrepCode()); String crep = aesEncryptUtils.decrypt(carKeyCommandRequest.getCrepCode());
...@@ -181,11 +180,11 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -181,11 +180,11 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
* 车钥匙操作指令批量上报 * 车钥匙操作指令批量上报
*/ */
@Override @Override
public int batchLogCommand(SmartCarKeyActionLogBatchRequest request) { public int batchLogCommand(CarKeyActionLogBatchRequest request) {
long userId = request.getUserId(); long userId = request.getUserId();
String actLogList = request.getActLogList(); String actLogList = request.getActLogList();
List<SmartCarKeyCommandRequest> lockingkeyActLogList = JSONArray.parseArray(actLogList, SmartCarKeyCommandRequest.class); List<CarKeyCommandRequest> lockingkeyActLogList = JSONArray.parseArray(actLogList, CarKeyCommandRequest.class);
if (CollectionUtils.isEmpty(lockingkeyActLogList)) { if (CollectionUtils.isEmpty(lockingkeyActLogList)) {
return 0; return 0;
} }
...@@ -204,7 +203,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -204,7 +203,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
* 车钥匙修改昵称 * 车钥匙修改昵称
*/ */
@Override @Override
public void setLockingKeyName(SmartCarKeyNameRequest request) { public void setLockingKeyName(CarKeyNameRequest request) {
String keyName = request.getKeyName(); String keyName = request.getKeyName();
String sn = request.getSn(); String sn = request.getSn();
...@@ -245,7 +244,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -245,7 +244,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
* 车钥匙修改自动感应 * 车钥匙修改自动感应
*/ */
@Override @Override
public void setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest request) { public void setLockingKeyAutoSense(CarKeyAutoSenseRequest request) {
long userId = request.getUserId(); long userId = request.getUserId();
String sn = request.getSn(); String sn = request.getSn();
String mobileMac = request.getMobileMac(); String mobileMac = request.getMobileMac();
...@@ -289,7 +288,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -289,7 +288,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
//根据用户ID查询车钥匙 //根据用户ID查询车钥匙
@Override @Override
public List<SmartCarKeyResponse> getAllKeyByUser(String userId) { public List<CarKeyResponse> getAllKeyByUser(String userId) {
//根据用户id查询车钥匙 //根据用户id查询车钥匙
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample(); SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria() example.createCriteria()
...@@ -303,8 +302,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -303,8 +302,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
} }
//转化为sn,完整车钥匙数据 //转化为sn,完整车钥匙数据
Map<String, SmartCarKeyResponse> smartCarKeyResponseMap = keyList.stream().map(key -> { Map<String, CarKeyResponse> smartCarKeyResponseMap = keyList.stream().map(key -> {
SmartCarKeyResponse response = new SmartCarKeyResponse(); CarKeyResponse response = new CarKeyResponse();
String crepCode = key.getCrepCode(); String crepCode = key.getCrepCode();
String secretKey_db = key.getSecretKey(); String secretKey_db = key.getSecretKey();
...@@ -316,12 +315,12 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -316,12 +315,12 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
response.setCrepCode(arr[0]); response.setCrepCode(arr[0]);
response.setSecretKey(arr[1]); response.setSecretKey(arr[1]);
return response; return response;
}).collect(Collectors.toMap(SmartCarKeyResponse::getSn, item -> item)); }).collect(Collectors.toMap(CarKeyResponse::getSn, item -> item));
List<SmartCarKeyResponse> responseList = new ArrayList<>(smartCarKeyResponseMap.values()); List<CarKeyResponse> responseList = new ArrayList<>(smartCarKeyResponseMap.values());
List<SmartCarKeyResponse> validList = new ArrayList(); List<CarKeyResponse> validList = new ArrayList();
//根据用户钥匙id,查询蓝牙,感应列表 //根据用户钥匙id,查询蓝牙,感应列表
List<Long> carKeyIds = keyList.stream().map(SmartVehicleBlueKey::getId).collect(Collectors.toList()); List<Long> carKeyIds = keyList.stream().map(SmartVehicleBlueKey::getId).collect(Collectors.toList());
...@@ -382,7 +381,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -382,7 +381,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
//智能车钥匙注册成功后的数据保存 //智能车钥匙注册成功后的数据保存
@Override @Override
public void saveLockingKeyRegisterInfo(SmartCarKeyRegisterRequest request) { public void saveLockingKeyRegisterInfo(CarKeyRegisterRequest request) {
String crepCode = request.getCrepCode(); String crepCode = request.getCrepCode();
String secretKey = request.getSecretKey(); String secretKey = request.getSecretKey();
//解密 //解密
...@@ -447,7 +446,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -447,7 +446,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
smartVehicleBlueKeyService.updateByPrimaryKeySelective(smartVehicleBlueKey); smartVehicleBlueKeyService.updateByPrimaryKeySelective(smartVehicleBlueKey);
} }
private void insertCarKey(String userId_str,String sn, SmartCarKeyResponse response, String crep) { private void insertCarKey(String userId_str, String sn, CarKeyResponse response, String crep) {
long userId = Long.parseLong(userId_str); long userId = Long.parseLong(userId_str);
long count = smartVehicleBlueKeyService.countKeyByUser(userId); long count = smartVehicleBlueKeyService.countKeyByUser(userId);
...@@ -482,7 +481,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -482,7 +481,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
BeanUtils.copyProperties(newKey, response); BeanUtils.copyProperties(newKey, response);
} }
private void buildCarKeyData(SmartCarKeyResponse response, SmartVehicleBlueKey carkey, String crepCode) { private void buildCarKeyData(CarKeyResponse response, SmartVehicleBlueKey carkey, String crepCode) {
//将数据库密钥解密成明文 //将数据库密钥解密成明文
String secretKey_db = carkey.getSecretKey(); String secretKey_db = carkey.getSecretKey();
...@@ -537,7 +536,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -537,7 +536,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
//主车钥匙修改分享状态 //主车钥匙修改分享状态
@Override @Override
public void setPrimaryLockingKeyShareStatus(SmartKeyPrimaryShareEditReq request) { public void setPrimaryLockingKeyShareStatus(KeyPrimaryShareEditReq request) {
Integer shareStatus = request.getShareStatus(); Integer shareStatus = request.getShareStatus();
SmartVehicleBlueKey smartVehicleBlueKey = smartVehicleBlueKeyService.selectByUserAndSnNotNull(Long.valueOf(request.getUserId()), request.getSn()); SmartVehicleBlueKey smartVehicleBlueKey = smartVehicleBlueKeyService.selectByUserAndSnNotNull(Long.valueOf(request.getUserId()), request.getSn());
......
...@@ -6,16 +6,17 @@ import cn.com.glsx.smart.common.redis.RedisService; ...@@ -6,16 +6,17 @@ import cn.com.glsx.smart.common.redis.RedisService;
import cn.com.glsx.smart.common.utils.AesEncryptUtils; import cn.com.glsx.smart.common.utils.AesEncryptUtils;
import cn.com.glsx.smart.common.utils.JwtUtil; import cn.com.glsx.smart.common.utils.JwtUtil;
import cn.com.glsx.smart.modules.entity.*; import cn.com.glsx.smart.modules.entity.*;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyReceiveRequest; import cn.com.glsx.smart.modules.model.request.CarKeyReceiveRequest;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareActionLogBatchRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogBatchRequest;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareLogRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogRequest;
import cn.com.glsx.smart.modules.model.request.SmartShareKeyDeleteRequest; import cn.com.glsx.smart.modules.model.request.ShareKeyDeleteRequest;
import cn.com.glsx.smart.modules.service.AiLockingKeyShareService; import cn.com.glsx.smart.modules.service.AiLockingKeyShareService;
import cn.com.glsx.smart.modules.service.SmartKeyCommandShareLogService; import cn.com.glsx.smart.modules.service.SmartKeyCommandShareLogService;
import cn.com.glsx.smart.modules.service.SmartVehicleBlueKeyService; import cn.com.glsx.smart.modules.service.SmartVehicleBlueKeyService;
import cn.com.glsx.smart.modules.service.SmartVehicleBlueShareKeyService; import cn.com.glsx.smart.modules.service.SmartVehicleBlueShareKeyService;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.glsx.cloudframework.core.util.DateFormatUtil;
import com.glsx.plat.common.utils.StringUtils; import com.glsx.plat.common.utils.StringUtils;
import io.jsonwebtoken.Claims; import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException; import io.jsonwebtoken.ExpiredJwtException;
...@@ -24,7 +25,6 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -24,7 +25,6 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -56,8 +56,6 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService { ...@@ -56,8 +56,6 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
@Autowired @Autowired
private AesEncryptUtils aesEncryptUtils; private AesEncryptUtils aesEncryptUtils;
//TODO R.Error处理
/** /**
* 通过令牌获取领取信息 * 通过令牌获取领取信息
*/ */
...@@ -104,7 +102,7 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService { ...@@ -104,7 +102,7 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
* 领取钥匙接口 * 领取钥匙接口
*/ */
@Override @Override
public void receiveKey(SmartCarKeyReceiveRequest request) { public void receiveKey(CarKeyReceiveRequest request) {
Long userId = request.getUserId(); Long userId = request.getUserId();
String token = request.getToken(); String token = request.getToken();
...@@ -135,7 +133,7 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService { ...@@ -135,7 +133,7 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
* 分享钥匙的操作日志 * 分享钥匙的操作日志
*/ */
@Override @Override
public void logShareLockingKeyCommand(SmartCarKeyShareLogRequest request) { public void logShareLockingKeyCommand(CarKeyShareLogRequest request) {
long keyId = request.getShareKeyId(); long keyId = request.getShareKeyId();
String command = request.getKeyCommand(); String command = request.getKeyCommand();
SmartKeyCommandShareLog logData = new SmartKeyCommandShareLog(); SmartKeyCommandShareLog logData = new SmartKeyCommandShareLog();
...@@ -149,10 +147,10 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService { ...@@ -149,10 +147,10 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
* 分享钥匙操作日志批量上报 * 分享钥匙操作日志批量上报
*/ */
@Override @Override
public int batchLogCommand(SmartCarKeyShareActionLogBatchRequest request) { public int batchLogCommand(CarKeyShareLogBatchRequest request) {
String actLogList = request.getActLogList(); String actLogList = request.getActLogList();
int count = 0; int count = 0;
List<SmartCarKeyShareLogRequest> lockingkeyActLogList = JSONArray.parseArray(actLogList, SmartCarKeyShareLogRequest.class); List<CarKeyShareLogRequest> lockingkeyActLogList = JSONArray.parseArray(actLogList, CarKeyShareLogRequest.class);
if (CollectionUtils.isEmpty(lockingkeyActLogList)) { if (CollectionUtils.isEmpty(lockingkeyActLogList)) {
return count; return count;
} }
...@@ -167,7 +165,7 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService { ...@@ -167,7 +165,7 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
* 删除共享钥匙,返回删除的时间 * 删除共享钥匙,返回删除的时间
*/ */
@Override @Override
public String removeShareKey(SmartShareKeyDeleteRequest request) { public String removeShareKey(ShareKeyDeleteRequest request) {
SmartVehicleBlueShareKey blueKey = new SmartVehicleBlueShareKey(); SmartVehicleBlueShareKey blueKey = new SmartVehicleBlueShareKey();
//分享状态关闭 //分享状态关闭
blueKey.setShareStatus(0); blueKey.setShareStatus(0);
...@@ -264,16 +262,11 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService { ...@@ -264,16 +262,11 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
SmartVehicleBlueShareKey shareKey = shareKeyService.selectByPrimaryKey(keyShareID); SmartVehicleBlueShareKey shareKey = shareKeyService.selectByPrimaryKey(keyShareID);
Date expireDate = shareKey.getExpireTime(); Date expireDate = shareKey.getExpireTime();
Date nowDate;
try {
nowDate = sdf.parse(nowTime);
} catch (ParseException e) {
e.printStackTrace();
throw ChejiaBusinessException.create(ResultEnum.CAR_KEY_DATE_FORMATE);
}
if (nowDate.after(expireDate)) { Date dateNow = DateFormatUtil.toDate(DateFormatUtil.nowString("yyyy-MM-dd"), "yyyy-MM-dd");
if (expireDate.before(dateNow)) {
throw ChejiaBusinessException.create(ResultEnum.CAR_KEY_DATE_EXPIRE); throw ChejiaBusinessException.create(ResultEnum.CAR_KEY_DATE_EXPIRE);
} }
......
...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.service.impl; ...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.service.impl;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandLog; import cn.com.glsx.smart.modules.entity.SmartKeyCommandLog;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandLogExample; import cn.com.glsx.smart.modules.entity.SmartKeyCommandLogExample;
import cn.com.glsx.smart.modules.mapper.SmartKeyCommandLogMapper; import cn.com.glsx.smart.modules.mapper.SmartKeyCommandLogMapper;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyCommandRequest; import cn.com.glsx.smart.modules.model.request.CarKeyCommandRequest;
import cn.com.glsx.smart.modules.service.SmartKeyCommandLogService; import cn.com.glsx.smart.modules.service.SmartKeyCommandLogService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -72,7 +72,7 @@ public class SmartKeyCommandLogServiceImpl implements SmartKeyCommandLogService ...@@ -72,7 +72,7 @@ public class SmartKeyCommandLogServiceImpl implements SmartKeyCommandLogService
} }
@Override @Override
public int insertBatch(List<SmartCarKeyCommandRequest> lockingkeyActLogList) { public int insertBatch(List<CarKeyCommandRequest> lockingkeyActLogList) {
return smartKeyCommandLogMapper.insertBatch(lockingkeyActLogList); return smartKeyCommandLogMapper.insertBatch(lockingkeyActLogList);
} }
......
...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.service.impl; ...@@ -3,7 +3,7 @@ package cn.com.glsx.smart.modules.service.impl;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLog; import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLog;
import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLogExample; import cn.com.glsx.smart.modules.entity.SmartKeyCommandShareLogExample;
import cn.com.glsx.smart.modules.mapper.SmartKeyCommandShareLogMapper; import cn.com.glsx.smart.modules.mapper.SmartKeyCommandShareLogMapper;
import cn.com.glsx.smart.modules.model.request.SmartCarKeyShareLogRequest; import cn.com.glsx.smart.modules.model.request.CarKeyShareLogRequest;
import cn.com.glsx.smart.modules.service.SmartKeyCommandShareLogService; import cn.com.glsx.smart.modules.service.SmartKeyCommandShareLogService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -72,7 +72,7 @@ public class SmartKeyCommandShareLogServiceImpl implements SmartKeyCommandShareL ...@@ -72,7 +72,7 @@ public class SmartKeyCommandShareLogServiceImpl implements SmartKeyCommandShareL
} }
@Override @Override
public int insertBatch(List<SmartCarKeyShareLogRequest> lockingkeyActLogList) { public int insertBatch(List<CarKeyShareLogRequest> lockingkeyActLogList) {
return smartKeyCommandShareLogMapper.insertBatch(lockingkeyActLogList); return smartKeyCommandShareLogMapper.insertBatch(lockingkeyActLogList);
} }
......
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</update> </update>
<insert id="insertBatch" parameterType="cn.com.glsx.smart.modules.model.request.SmartCarKeyCommandRequest"> <insert id="insertBatch" parameterType="cn.com.glsx.smart.modules.model.request.CarKeyCommandRequest">
INSERT INTO `smart_key_command_log` (`user_id`, `crep_code`, `key_command`, `create_time`) INSERT INTO `smart_key_command_log` (`user_id`, `crep_code`, `key_command`, `create_time`)
VALUES VALUES
<foreach collection="lockingkeyActLogList" item="keyActLog" separator=","> <foreach collection="lockingkeyActLogList" item="keyActLog" separator=",">
......
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<insert id="insertBatch" parameterType="cn.com.glsx.smart.modules.model.request.SmartCarKeyShareLogRequest"> <insert id="insertBatch" parameterType="cn.com.glsx.smart.modules.model.request.CarKeyShareLogRequest">
INSERT INTO `smart_key_command_share_log` (`share_car_key_id`, `key_command`, `create_time`) INSERT INTO `smart_key_command_share_log` (`share_car_key_id`, `key_command`, `create_time`)
VALUES VALUES
<foreach collection="lockingkeyActLogList" item="keyActLog" separator=","> <foreach collection="lockingkeyActLogList" item="keyActLog" separator=",">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!