1.修改门禁卡输入空不能提交到bug
This commit is contained in:
gaoben 2021-11-08 11:26:59 +08:00
parent 40c2da9d96
commit 4d60ca38aa
3 changed files with 52 additions and 40 deletions

View File

@ -141,6 +141,9 @@ public class SysRoleController extends AbstractController {
//ValidatorUtils.validateEntity(role); //ValidatorUtils.validateEntity(role);
role.setCreateBy(getUser().getNickName()); role.setCreateBy(getUser().getNickName());
role.setCreateTime(new Date()); role.setCreateTime(new Date());
if(role.getRoleName().length()>32){
return R.error("角色名称太长");
}
sysRoleService.saveRole(role); sysRoleService.saveRole(role);
return R.ok(); return R.ok();

View File

@ -433,7 +433,11 @@ public class TenPersonController extends AbstractController {
return R.error("卡号已录入"); return R.error("卡号已录入");
} }
} }
}else{ }
else if(tenPerson.getDoorCardEntity().getDoorCard().trim().equals("")){
}
else{
tenPerson.setDoorCardEntity(null); tenPerson.setDoorCardEntity(null);
} }

View File

@ -1099,8 +1099,9 @@ public class TenPersonServiceImpl implements TenPersonService {
} }
if (entity.getDoorCardEntity() != null) { if (entity.getDoorCardEntity() != null) {
// TenDoorCardEntity oldCard = tenDoorCardService.getOne(new QueryWrapper<TenDoorCardEntity>() if(entity.getDoorCardEntity().getDoorCard().trim().length()>0){
// .eq("person_id", entity.getPersonId())); // TenDoorCardEntity oldCard = tenDoorCardService.getOne(new QueryWrapper<TenDoorCardEntity>()
// .eq("person_id", entity.getPersonId()));
List<TenDoorCardEntity> personDoorCardList = tenDoorCardService.list( List<TenDoorCardEntity> personDoorCardList = tenDoorCardService.list(
new QueryWrapper<TenDoorCardEntity>() new QueryWrapper<TenDoorCardEntity>()
@ -1127,13 +1128,13 @@ public class TenPersonServiceImpl implements TenPersonService {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(date);//设置起时间 cal.setTime(date);//设置起时间
cal.add(Calendar.YEAR, 10);//增加一年 cal.add(Calendar.YEAR, 10);//增加一年
// System.out.println("输出::"+cal.getTime()); // System.out.println("输出::"+cal.getTime());
newCard.setValidEnd(cal.getTime()); newCard.setValidEnd(cal.getTime());
} else { } else {
newCard.setValidEnd(entity.getDoorCardEntity().getValidEnd()); newCard.setValidEnd(entity.getDoorCardEntity().getValidEnd());
} }
// newCard.setValidBegin(entity.getDoorCardEntity().getValidBegin()); // newCard.setValidBegin(entity.getDoorCardEntity().getValidBegin());
// newCard.setValidEnd(entity.getDoorCardEntity().getValidEnd()); // newCard.setValidEnd(entity.getDoorCardEntity().getValidEnd());
newCard.setCellId(entity.getCellId()); newCard.setCellId(entity.getCellId());
newCard.setDoorCard(entity.getDoorCardEntity().getDoorCard()); newCard.setDoorCard(entity.getDoorCardEntity().getDoorCard());
Date now = new Date(); Date now = new Date();
@ -1143,6 +1144,10 @@ public class TenPersonServiceImpl implements TenPersonService {
}else{ }else{
} }
}else{
//删除卡号
tenDoorCardService.removeById(entity.getDoorCardEntity().getDoorCardId());
}
// if (oldCard != null) { // if (oldCard != null) {
// //修改 卡号为空删除记录 // //修改 卡号为空删除记录