refactor(aop): 修改控制器切面切入点表达式并增加组织ID字段

- 将控制器切面的切入点表达式从 execution 改为 within,提高灵活性
- 在 SmartCamCarLicenseSnapshotDataService 中为 smartCamCarDataEntity 和 byNumber 实体添加 organizationId 字段
This commit is contained in:
2025-04-06 22:08:02 +08:00
parent 0222d99843
commit 535c06c0b6
2 changed files with 4 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ public class ControllerAop {
@Autowired PojoProcessor pojoProcessor;
@Pointcut("execution (* cn.lihongjie.coal.*.controller.*.*(..))")
@Pointcut("within (cn.lihongjie.coal..*.controller..*)")
public void controllerMethods() {}
@SneakyThrows

View File

@@ -326,6 +326,7 @@ public class SmartCamCarLicenseSnapshotDataService
smartCamCarDataEntity.setEntry(entity);
smartCamCarDataEntity.setEntryTime(entity.getInfoTimeObj());
smartCamCarDataEntity.setOrganizationId(entity.getOrganizationId());
smartCamCarDataRepository.save(smartCamCarDataEntity);
} else {
@@ -334,6 +335,7 @@ public class SmartCamCarLicenseSnapshotDataService
smartCamCarDataEntity.setNumber(entity.getNumber());
smartCamCarDataEntity.setExit(entity);
smartCamCarDataEntity.setExitTime(entity.getInfoTimeObj());
smartCamCarDataEntity.setOrganizationId(entity.getOrganizationId());
smartCamCarDataRepository.save(smartCamCarDataEntity);
}
@@ -348,6 +350,7 @@ public class SmartCamCarLicenseSnapshotDataService
byNumber.setExit(entity);
byNumber.setExitTime(entity.getInfoTimeObj());
byNumber.setOrganizationId(entity.getOrganizationId());
smartCamCarDataRepository.save(byNumber);
}
}