refactor(client): 重构服务类继承关系并统一使用QueryService
重构所有服务类,使其继承自QueryService接口,统一数据查询逻辑。同时为服务类添加@Service注解,确保Spring容器管理。更新相关FXML文件的控制器路径,从manager.ds调整为controller目录结构。调整pom.xml版本号至0.0.84-SNAPSHOT。新增MessageNotitfication和SimpleMessage消息类,提供基础消息结构支持。
This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
package com.ecep.contract.ds.other.repository;
|
||||
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ecep.contract.ds.MyRepository;
|
||||
import com.ecep.contract.model.EmployeeLoginHistory;
|
||||
|
||||
@Lazy
|
||||
@Repository
|
||||
public interface EmployeeLoginHistoryRepository extends
|
||||
// JDBC interfaces
|
||||
CrudRepository<EmployeeLoginHistory, Integer>,
|
||||
PagingAndSortingRepository<EmployeeLoginHistory, Integer>,
|
||||
// JPA interfaces
|
||||
JpaRepository<EmployeeLoginHistory, Integer>, JpaSpecificationExecutor<EmployeeLoginHistory> {
|
||||
public interface EmployeeLoginHistoryRepository extends MyRepository<EmployeeLoginHistory, Integer> {
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.ecep.contract.ds.other.repository;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ecep.contract.ds.MyRepository;
|
||||
@@ -20,9 +18,4 @@ public interface EmployeeRepository extends MyRepository<Employee, Integer> {
|
||||
Optional<Employee> findByAlias(String alias);
|
||||
|
||||
Optional<Employee> findByCode(String personCode);
|
||||
|
||||
@Modifying
|
||||
@Query(value = "update EMPLOYEE_LOGIN_HISTORY e set e.LATEST_ACTIVE = now() where e.id = ?1", nativeQuery = true)
|
||||
void updateActive(int sessionId);
|
||||
|
||||
}
|
||||
|
||||
@@ -141,11 +141,6 @@ public class EmployeeService implements IEntityService<Employee> {
|
||||
return employeeRepository.findAll(spec, Pageable.ofSize(10)).getContent();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void updateActive(int sessionId) {
|
||||
employeeRepository.updateActive(sessionId);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<EmployeeRole> getRolesByEmployeeId(int employeeId) {
|
||||
Optional<Employee> optional = employeeRepository.findById(employeeId);
|
||||
|
||||
Reference in New Issue
Block a user