|
@@ -7,6 +7,7 @@ import com.template.common.utils.PasswordChecker;
|
|
|
import com.template.model.dto.KeyCardDto;
|
|
import com.template.model.dto.KeyCardDto;
|
|
|
import com.template.model.dto.KeyFingerprintDto;
|
|
import com.template.model.dto.KeyFingerprintDto;
|
|
|
import com.template.model.dto.KeyPassWordDto;
|
|
import com.template.model.dto.KeyPassWordDto;
|
|
|
|
|
+import com.template.model.dto.UpdateLockDto;
|
|
|
import com.template.model.pojo.*;
|
|
import com.template.model.pojo.*;
|
|
|
import com.template.model.result.CommonResult;
|
|
import com.template.model.result.CommonResult;
|
|
|
import com.template.services.*;
|
|
import com.template.services.*;
|
|
@@ -85,11 +86,11 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
if (ObjectUtils.isEmpty(houseNumber)) {
|
|
if (ObjectUtils.isEmpty(houseNumber)) {
|
|
|
return CommonResult.fail("该房间不存在");
|
|
return CommonResult.fail("该房间不存在");
|
|
|
}
|
|
}
|
|
|
- String usersId = keyPassWordDto.getUsersId();
|
|
|
|
|
- Users byId = usersService.getById(usersId);
|
|
|
|
|
- if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
- return CommonResult.fail("无该用户");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// String usersId = keyPassWordDto.getUsersId();
|
|
|
|
|
+// Users byId = usersService.getById(usersId);
|
|
|
|
|
+// if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
+// return CommonResult.fail("无该用户");
|
|
|
|
|
+// }
|
|
|
UnlockingAdmin unlockingAdmin = null;
|
|
UnlockingAdmin unlockingAdmin = null;
|
|
|
/**
|
|
/**
|
|
|
* 缺少人的名字和
|
|
* 缺少人的名字和
|
|
@@ -101,8 +102,8 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
return CommonResult.fail("该密码已存在,请更换");
|
|
return CommonResult.fail("该密码已存在,请更换");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- unlockingAdmin.setName(byId.getUserName());
|
|
|
|
|
- unlockingAdmin.setPhone(byId.getPhone());
|
|
|
|
|
|
|
+ unlockingAdmin.setName(admin.getName());
|
|
|
|
|
+ unlockingAdmin.setPhone(admin.getPhoneNumber());
|
|
|
|
|
|
|
|
// 添加操作记录
|
|
// 添加操作记录
|
|
|
|
|
|
|
@@ -112,7 +113,7 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
operatingRecord.setOperatorName(admin.getName());
|
|
operatingRecord.setOperatorName(admin.getName());
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
|
|
operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
|
|
|
- operatingRecord.setContent("姓名:" + byId.getUserName());
|
|
|
|
|
|
|
+ operatingRecord.setContent("姓名:" + admin.getName());
|
|
|
operatingRecord.setType("添加密码钥匙");
|
|
operatingRecord.setType("添加密码钥匙");
|
|
|
|
|
|
|
|
|
|
|
|
@@ -151,19 +152,19 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
if (ObjectUtils.isEmpty(houseNumber)) {
|
|
if (ObjectUtils.isEmpty(houseNumber)) {
|
|
|
return CommonResult.fail("该房间不存在");
|
|
return CommonResult.fail("该房间不存在");
|
|
|
}
|
|
}
|
|
|
- String usersId = keyCardDto.getUsersId();
|
|
|
|
|
- Users byId = usersService.getById(usersId);
|
|
|
|
|
- if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
- return CommonResult.fail("无该用户");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// String usersId = keyCardDto.getUsersId();
|
|
|
|
|
+// Users byId = usersService.getById(usersId);
|
|
|
|
|
+// if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
+// return CommonResult.fail("无该用户");
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
UnlockingAdmin unlockingAdmin = null;
|
|
UnlockingAdmin unlockingAdmin = null;
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
unlockingAdmin = passwordIssController.addCard(keyCardDto);
|
|
unlockingAdmin = passwordIssController.addCard(keyCardDto);
|
|
|
|
|
|
|
|
- unlockingAdmin.setName(byId.getUserName());
|
|
|
|
|
- unlockingAdmin.setPhone(byId.getPhone());
|
|
|
|
|
|
|
+ unlockingAdmin.setName(admin.getName());
|
|
|
|
|
+ unlockingAdmin.setPhone(admin.getPhoneNumber());
|
|
|
|
|
|
|
|
// 添加操作记录
|
|
// 添加操作记录
|
|
|
|
|
|
|
@@ -174,7 +175,7 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
operatingRecord.setOperatorName(admin.getName());
|
|
operatingRecord.setOperatorName(admin.getName());
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
|
|
operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
|
|
|
- operatingRecord.setContent("姓名:" + byId.getUserName());
|
|
|
|
|
|
|
+ operatingRecord.setContent("姓名:" + admin.getName());
|
|
|
operatingRecord.setType("添加卡片钥匙");
|
|
operatingRecord.setType("添加卡片钥匙");
|
|
|
|
|
|
|
|
|
|
|
|
@@ -213,19 +214,19 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
if (ObjectUtils.isEmpty(houseNumber)) {
|
|
if (ObjectUtils.isEmpty(houseNumber)) {
|
|
|
return CommonResult.fail("该房间不存在");
|
|
return CommonResult.fail("该房间不存在");
|
|
|
}
|
|
}
|
|
|
- String usersId = keyFingerprintDto.getUsersId();
|
|
|
|
|
- Users byId = usersService.getById(usersId);
|
|
|
|
|
- if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
- return CommonResult.fail("无该用户");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// String usersId = keyFingerprintDto.getUsersId();
|
|
|
|
|
+// Users byId = usersService.getById(usersId);
|
|
|
|
|
+// if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
+// return CommonResult.fail("无该用户");
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
UnlockingAdmin unlockingAdmin = null;
|
|
UnlockingAdmin unlockingAdmin = null;
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
unlockingAdmin = passwordIssController.addFingerprintDto(keyFingerprintDto);
|
|
unlockingAdmin = passwordIssController.addFingerprintDto(keyFingerprintDto);
|
|
|
|
|
|
|
|
- unlockingAdmin.setName(byId.getUserName());
|
|
|
|
|
- unlockingAdmin.setPhone(byId.getPhone());
|
|
|
|
|
|
|
+ unlockingAdmin.setName(admin.getName());
|
|
|
|
|
+ unlockingAdmin.setPhone(admin.getPhoneNumber());
|
|
|
|
|
|
|
|
// 添加操作记录
|
|
// 添加操作记录
|
|
|
|
|
|
|
@@ -235,7 +236,7 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
operatingRecord.setOperatorName(admin.getName());
|
|
operatingRecord.setOperatorName(admin.getName());
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
|
|
operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
|
|
|
- operatingRecord.setContent("姓名:" + byId.getUserName());
|
|
|
|
|
|
|
+ operatingRecord.setContent("姓名:" + admin.getName());
|
|
|
operatingRecord.setType("添加指纹钥匙");
|
|
operatingRecord.setType("添加指纹钥匙");
|
|
|
|
|
|
|
|
|
|
|
|
@@ -252,8 +253,34 @@ public class UnlockingAdminController implements UnlockingAdminControllerAPI {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult deleteLock(Integer unlockingAdminId) {
|
|
|
|
|
+ UnlockingAdmin byId = unlockingAdminService.getById(unlockingAdminId);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
+ return CommonResult.fail("不存在该记录");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String lockUserId = byId.getLockUserId();
|
|
|
|
|
+ String luid = byId.getLuid();
|
|
|
|
|
|
|
|
|
|
+ passwordIssController.deleteLockUser(luid,lockUserId);
|
|
|
|
|
|
|
|
|
|
+ unlockingAdminService.removeById(unlockingAdminId);
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult updateLock(UpdateLockDto updateLockDto) {
|
|
|
|
|
+ UnlockingAdmin byId = unlockingAdminService.getById(updateLockDto.getUnlockingAdminId());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(byId)) {
|
|
|
|
|
+ return CommonResult.fail("不存在该记录");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String luid = byId.getLuid();
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|