Compare commits
1 Commits
15c8303c0d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4ae39c587 |
@@ -57,11 +57,9 @@
|
|||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.30</version>
|
</dependency>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.example.rhizome.app.domain.model;
|
package com.example.rhizome.app.domain.model;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@@ -39,9 +37,5 @@ public class Employee {
|
|||||||
* 部署ID
|
* 部署ID
|
||||||
*/
|
*/
|
||||||
private final Integer idDepartment;
|
private final Integer idDepartment;
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private final LocalDate dateHired;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.example.rhizome.app.domain.model;
|
package com.example.rhizome.app.domain.model;
|
||||||
|
|
||||||
import java.time.Period;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@@ -26,10 +24,5 @@ public class EmployeeInfo {
|
|||||||
* 部署名
|
* 部署名
|
||||||
*/
|
*/
|
||||||
private final Department department;
|
private final Department department;
|
||||||
|
|
||||||
/**
|
|
||||||
* 勤続年数
|
|
||||||
*/
|
|
||||||
private final Period lengthOfService;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.example.rhizome.app.domain.model;
|
package com.example.rhizome.app.domain.model;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@@ -41,11 +39,6 @@ public class LoginUser {
|
|||||||
* 部署ID
|
* 部署ID
|
||||||
*/
|
*/
|
||||||
private final Integer idDepartment;
|
private final Integer idDepartment;
|
||||||
|
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private final LocalDate dateHired;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ログインユーザが管理者か
|
* ログインユーザが管理者か
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
package com.example.rhizome.app.domain.service.impl;
|
package com.example.rhizome.app.domain.service.impl;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.Period;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.jpa.domain.Specification;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
||||||
import com.example.rhizome.app.domain.model.SearchConditionEmployee;
|
import com.example.rhizome.app.domain.model.SearchConditionEmployee;
|
||||||
import com.example.rhizome.app.domain.service.SearchEmployeeInfo;
|
import com.example.rhizome.app.domain.service.SearchEmployeeInfo;
|
||||||
import com.example.rhizome.app.infra.entity.EmployeeDepartmentEntity;
|
import com.example.rhizome.app.infra.entity.EmployeeDepartmentEntity;
|
||||||
import com.example.rhizome.app.infra.repository.EmployeeInfoRepository;
|
import com.example.rhizome.app.infra.repository.EmployeeInfoRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SearchEmployeeInfoImpl (employee join department) 検索系の機能を集約させるサービスクラスです
|
* SearchEmployeeInfoImpl (employee join department) 検索系の機能を集約させるサービスクラスです
|
||||||
@@ -23,55 +19,44 @@ import com.example.rhizome.app.infra.repository.EmployeeInfoRepository;
|
|||||||
@Transactional
|
@Transactional
|
||||||
public class SearchEmployeeInfoImpl implements SearchEmployeeInfo {
|
public class SearchEmployeeInfoImpl implements SearchEmployeeInfo {
|
||||||
|
|
||||||
EmployeeInfoRepository employeeInfoRepository;
|
EmployeeInfoRepository employeeInfoRepository;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public SearchEmployeeInfoImpl(EmployeeInfoRepository employeeInfoRepository) {
|
public SearchEmployeeInfoImpl(EmployeeInfoRepository employeeInfoRepository) {
|
||||||
this.employeeInfoRepository = employeeInfoRepository;
|
this.employeeInfoRepository = employeeInfoRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* EmployeeInfo (employee join department) のレコードを全件取得
|
|
||||||
*
|
|
||||||
* @return 取得したレコード全件
|
|
||||||
*/
|
|
||||||
public List<EmployeeInfo> selectAll() {
|
|
||||||
|
|
||||||
List<EmployeeDepartmentEntity> entityList = employeeInfoRepository.findAll();
|
/**
|
||||||
List<Period> lengthOfServiceList = new ArrayList<>();
|
* EmployeeInfo (employee join department) のレコードを全件取得
|
||||||
|
*
|
||||||
|
* @return 取得したレコード全件
|
||||||
|
*/
|
||||||
|
public List<EmployeeInfo> selectAll() {
|
||||||
|
|
||||||
for (EmployeeDepartmentEntity entity : entityList) {
|
return EmployeeDepartmentEntity.createEmployeeInfoList(employeeInfoRepository.findAll());
|
||||||
lengthOfServiceList.add(Period.between(entity.getDateHired(), LocalDate.now()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return EmployeeDepartmentEntity.createEmployeeInfoList(entityList, lengthOfServiceList);
|
}
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* SearchConditionEmployee の情報を元に EmployeeInfo (employee join department) のレコードを取得
|
||||||
|
*
|
||||||
|
* @param searchConditionEmployee 検索条件
|
||||||
|
* @return 検索結果のレコードリスト
|
||||||
|
*/
|
||||||
|
public List<EmployeeInfo> searchBy(SearchConditionEmployee searchConditionEmployee) {
|
||||||
|
// 動的に検索条件を絞り込む
|
||||||
|
// Specification は Criteria API の Predicate をラップしたもの
|
||||||
|
return EmployeeDepartmentEntity
|
||||||
|
.createEmployeeInfoList(
|
||||||
|
employeeInfoRepository.findAll(Specification
|
||||||
|
.where(EmployeeInfoRepository.idEmployeeEqual(searchConditionEmployee.getIdEmployee()))
|
||||||
|
.and(EmployeeInfoRepository.nmEmployeeEqual(searchConditionEmployee.getNmEmployee()))
|
||||||
|
.and(EmployeeInfoRepository.knEmployeeEqual(searchConditionEmployee.getKnEmployee()))
|
||||||
|
.and(EmployeeInfoRepository.mailAddressEqual(searchConditionEmployee.getMailAddress()))
|
||||||
|
.and(EmployeeInfoRepository.idDepartmentEqual(searchConditionEmployee.getIdDepartment()))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
}
|
||||||
* SearchConditionEmployee の情報を元に EmployeeInfo (employee join department) のレコードを取得
|
|
||||||
*
|
|
||||||
* @param searchConditionEmployee 検索条件
|
|
||||||
* @return 検索結果のレコードリスト
|
|
||||||
*/
|
|
||||||
public List<EmployeeInfo> searchBy(SearchConditionEmployee searchConditionEmployee) {
|
|
||||||
// 動的に検索条件を絞り込む
|
|
||||||
// Specification は Criteria API の Predicate をラップしたもの
|
|
||||||
List<EmployeeDepartmentEntity> entityList = employeeInfoRepository.findAll(Specification
|
|
||||||
.where(EmployeeInfoRepository.idEmployeeEqual(searchConditionEmployee.getIdEmployee()))
|
|
||||||
.and(EmployeeInfoRepository.nmEmployeeEqual(searchConditionEmployee.getNmEmployee()))
|
|
||||||
.and(EmployeeInfoRepository.knEmployeeEqual(searchConditionEmployee.getKnEmployee()))
|
|
||||||
.and(EmployeeInfoRepository.mailAddressEqual(searchConditionEmployee.getMailAddress()))
|
|
||||||
.and(EmployeeInfoRepository.idDepartmentEqual(searchConditionEmployee.getIdDepartment())));
|
|
||||||
|
|
||||||
List<Period> lengthOfServiceList = new ArrayList<>();
|
|
||||||
|
|
||||||
for (EmployeeDepartmentEntity entity : entityList) {
|
|
||||||
lengthOfServiceList.add(Period.between(entity.getDateHired(), LocalDate.now()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return EmployeeDepartmentEntity.createEmployeeInfoList(entityList, lengthOfServiceList);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.example.rhizome.app.domain.service.impl;
|
package com.example.rhizome.app.domain.service.impl;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
import com.example.rhizome.app.domain.service.UpdateEmployee;
|
import com.example.rhizome.app.domain.service.UpdateEmployee;
|
||||||
import com.example.rhizome.app.infra.entity.EmployeeEntity;
|
import com.example.rhizome.app.infra.entity.EmployeeEntity;
|
||||||
import com.example.rhizome.app.infra.repository.EmployeeRepository;
|
import com.example.rhizome.app.infra.repository.EmployeeRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* employee の更新系の機能を集約させるサービスクラスです。
|
* employee の更新系の機能を集約させるサービスクラスです。
|
||||||
@@ -53,8 +52,7 @@ public class UpdateEmployeeImpl implements UpdateEmployee {
|
|||||||
updateEmployee.getMailAddress(),
|
updateEmployee.getMailAddress(),
|
||||||
updateEmployee.getPassword().isBlank() ? beforeEmployee.getPassword() : updateEmployee.getPassword(),
|
updateEmployee.getPassword().isBlank() ? beforeEmployee.getPassword() : updateEmployee.getPassword(),
|
||||||
updateEmployee.getAdminAuth() == null ? beforeEmployee.getAdminAuth() : updateEmployee.getAdminAuth(),
|
updateEmployee.getAdminAuth() == null ? beforeEmployee.getAdminAuth() : updateEmployee.getAdminAuth(),
|
||||||
updateEmployee.getIdDepartment() == null ? beforeEmployee.getIdDepartment() : updateEmployee.getIdDepartment(),
|
updateEmployee.getIdDepartment() == null ? beforeEmployee.getIdDepartment() : updateEmployee.getIdDepartment()
|
||||||
beforeEmployee.getDateHired()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,16 @@
|
|||||||
package com.example.rhizome.app.infra.entity;
|
package com.example.rhizome.app.infra.entity;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.Period;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.IntStream;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.GenerationType;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.ManyToOne;
|
|
||||||
import javax.persistence.NamedEntityGraph;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.Fetch;
|
|
||||||
import org.hibernate.annotations.FetchMode;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.Department;
|
import com.example.rhizome.app.domain.model.Department;
|
||||||
import com.example.rhizome.app.domain.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Fetch;
|
||||||
|
import org.hibernate.annotations.FetchMode;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee + Department の Join 情報を保持するEntity
|
* Employee + Department の Join 情報を保持するEntity
|
||||||
@@ -84,21 +70,14 @@ public class EmployeeDepartmentEntity {
|
|||||||
@JoinColumn(name = "id_department", referencedColumnName = "id_department", insertable = false, updatable = false)
|
@JoinColumn(name = "id_department", referencedColumnName = "id_department", insertable = false, updatable = false)
|
||||||
@Fetch(FetchMode.JOIN)
|
@Fetch(FetchMode.JOIN)
|
||||||
private DepartmentEntity department;
|
private DepartmentEntity department;
|
||||||
|
|
||||||
/*
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
@Column(name = "date_hired", nullable = false)
|
|
||||||
private LocalDate dateHired;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EmployeeDepartmentEntity(DataAccess層依存) を EmployeeInfo(BusinessLogic層依存) に変換します。
|
* EmployeeDepartmentEntity(DataAccess層依存) を EmployeeInfo(BusinessLogic層依存) に変換します。
|
||||||
*
|
*
|
||||||
* @param employeeDepartmentEntity EmployeeDepartmentEntity のインスタンス
|
* @param employeeDepartmentEntity EmployeeDepartmentEntity のインスタンス
|
||||||
* @param lengthOfService 勤続年数
|
|
||||||
* @return EmployeeInfo のインスタンス
|
* @return EmployeeInfo のインスタンス
|
||||||
*/
|
*/
|
||||||
public static EmployeeInfo createEmployeeInfo(EmployeeDepartmentEntity employeeDepartmentEntity, Period lengthOfService) {
|
public static EmployeeInfo createEmployeeInfo(EmployeeDepartmentEntity employeeDepartmentEntity) {
|
||||||
|
|
||||||
// コンストラクタを使って書くとSetterを使用するより簡略化出来ます。
|
// コンストラクタを使って書くとSetterを使用するより簡略化出来ます。
|
||||||
// 混乱してしまう人は落ち着いて EmployeeInfo のフィールドを見に行って、
|
// 混乱してしまう人は落ち着いて EmployeeInfo のフィールドを見に行って、
|
||||||
@@ -111,14 +90,12 @@ public class EmployeeDepartmentEntity {
|
|||||||
employeeDepartmentEntity.getMailAddress(),
|
employeeDepartmentEntity.getMailAddress(),
|
||||||
employeeDepartmentEntity.getPassword(),
|
employeeDepartmentEntity.getPassword(),
|
||||||
employeeDepartmentEntity.getAdminAuth(),
|
employeeDepartmentEntity.getAdminAuth(),
|
||||||
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getIdDepartment(),
|
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getIdDepartment()
|
||||||
employeeDepartmentEntity.getDateHired()
|
|
||||||
),
|
),
|
||||||
new Department(
|
new Department(
|
||||||
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getIdDepartment(),
|
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getIdDepartment(),
|
||||||
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getNmDepartment()
|
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getNmDepartment()
|
||||||
),
|
)
|
||||||
lengthOfService
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -128,25 +105,14 @@ public class EmployeeDepartmentEntity {
|
|||||||
* (リスト版)
|
* (リスト版)
|
||||||
*
|
*
|
||||||
* @param employeeDepartmentEntityList EmployeeDepartmentEntity インスタンスのリスト
|
* @param employeeDepartmentEntityList EmployeeDepartmentEntity インスタンスのリスト
|
||||||
* @param 勤続年数のリスト
|
|
||||||
* @return EmployeeInfo インスタンスのリスト
|
* @return EmployeeInfo インスタンスのリスト
|
||||||
*/
|
*/
|
||||||
public static List<EmployeeInfo> createEmployeeInfoList(
|
public static List<EmployeeInfo> createEmployeeInfoList(List<EmployeeDepartmentEntity> employeeDepartmentEntityList) {
|
||||||
List<EmployeeDepartmentEntity> employeeDepartmentEntityList,
|
|
||||||
List<Period> lengthOfServiceList) {
|
|
||||||
|
|
||||||
if (employeeDepartmentEntityList.size() != lengthOfServiceList.size()) {
|
// StreamAPI を使うとこうなります。
|
||||||
throw new IllegalArgumentException(
|
return employeeDepartmentEntityList.stream().map(EmployeeDepartmentEntity::createEmployeeInfo).toList();
|
||||||
"社員情報と勤続年数の件数が一致しません。");
|
|
||||||
}
|
|
||||||
|
|
||||||
return IntStream.range(0, employeeDepartmentEntityList.size())
|
|
||||||
.mapToObj(index -> EmployeeDepartmentEntity
|
|
||||||
.createEmployeeInfo(employeeDepartmentEntityList.get(index), lengthOfServiceList.get(index)))
|
|
||||||
.toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,24 +7,16 @@
|
|||||||
package com.example.rhizome.app.infra.entity;
|
package com.example.rhizome.app.infra.entity;
|
||||||
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.GenerationType;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
import com.example.rhizome.app.domain.model.LoginUser;
|
import com.example.rhizome.app.domain.model.LoginUser;
|
||||||
import com.example.rhizome.app.domain.model.SearchConditionEmployee;
|
import com.example.rhizome.app.domain.model.SearchConditionEmployee;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EmployeeテーブルのEntity
|
* EmployeeテーブルのEntity
|
||||||
*
|
*
|
||||||
@@ -80,12 +72,6 @@ public class EmployeeEntity {
|
|||||||
*/
|
*/
|
||||||
@Column(name = "id_department", nullable = false)
|
@Column(name = "id_department", nullable = false)
|
||||||
private Integer idDepartment;
|
private Integer idDepartment;
|
||||||
|
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
@Column(name = "date_hired", nullable = false)
|
|
||||||
private LocalDate dateHired;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,8 +89,7 @@ public class EmployeeEntity {
|
|||||||
employee.getMailAddress(),
|
employee.getMailAddress(),
|
||||||
employee.getPassword(),
|
employee.getPassword(),
|
||||||
employee.getAdminAuth(),
|
employee.getAdminAuth(),
|
||||||
employee.getIdDepartment(),
|
employee.getIdDepartment()
|
||||||
employee.getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,8 +129,7 @@ public class EmployeeEntity {
|
|||||||
employeeEntity.getMailAddress(),
|
employeeEntity.getMailAddress(),
|
||||||
employeeEntity.getPassword(),
|
employeeEntity.getPassword(),
|
||||||
employeeEntity.getAdminAuth(),
|
employeeEntity.getAdminAuth(),
|
||||||
employeeEntity.getIdDepartment(),
|
employeeEntity.getIdDepartment()
|
||||||
employeeEntity.getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,8 +167,7 @@ public class EmployeeEntity {
|
|||||||
getMailAddress(),
|
getMailAddress(),
|
||||||
getPassword(),
|
getPassword(),
|
||||||
getAdminAuth(),
|
getAdminAuth(),
|
||||||
getIdDepartment(),
|
getIdDepartment()
|
||||||
getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,5 @@
|
|||||||
package com.example.rhizome.app.presentation.controller;
|
package com.example.rhizome.app.presentation.controller;
|
||||||
|
|
||||||
import static com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword.*;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
|
|
||||||
import com.example.rhizome.aop.aspect.PermissionCheck;
|
import com.example.rhizome.aop.aspect.PermissionCheck;
|
||||||
import com.example.rhizome.aop.aspect.SessionCheck;
|
import com.example.rhizome.aop.aspect.SessionCheck;
|
||||||
import com.example.rhizome.app.domain.service.RegisterEmployee;
|
import com.example.rhizome.app.domain.service.RegisterEmployee;
|
||||||
@@ -28,6 +11,20 @@ import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTa
|
|||||||
import com.example.rhizome.app.presentation.form.DepartmentForm;
|
import com.example.rhizome.app.presentation.form.DepartmentForm;
|
||||||
import com.example.rhizome.app.presentation.form.InsertEmployeeForm;
|
import com.example.rhizome.app.presentation.form.InsertEmployeeForm;
|
||||||
import com.example.rhizome.app.presentation.form.MessageForm;
|
import com.example.rhizome.app.presentation.form.MessageForm;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import static com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword.INSERT_EMPLOYEE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新規登録用のコントローラ
|
* 新規登録用のコントローラ
|
||||||
@@ -85,8 +82,7 @@ public class InsertEmployeeController {
|
|||||||
insertEmployeeForm.getMailAddress(),
|
insertEmployeeForm.getMailAddress(),
|
||||||
insertEmployeeForm.getPassword(),
|
insertEmployeeForm.getPassword(),
|
||||||
insertEmployeeForm.getAdminAuth(),
|
insertEmployeeForm.getAdminAuth(),
|
||||||
insertEmployeeForm.getIdDepartment(),
|
insertEmployeeForm.getIdDepartment()
|
||||||
insertEmployeeForm.getDateHired()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// エラーが1件以上有る場合
|
// エラーが1件以上有る場合
|
||||||
@@ -130,8 +126,7 @@ public class InsertEmployeeController {
|
|||||||
String mailAddress,
|
String mailAddress,
|
||||||
String password,
|
String password,
|
||||||
Integer management,
|
Integer management,
|
||||||
Integer departmentId,
|
Integer departmentId
|
||||||
LocalDate hireDate
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
final String EMPLOYEE_NAME_NULL_BLANK = "社員名";
|
final String EMPLOYEE_NAME_NULL_BLANK = "社員名";
|
||||||
@@ -140,7 +135,6 @@ public class InsertEmployeeController {
|
|||||||
final String PASSWORD_NULL_BLANK = "パスワード";
|
final String PASSWORD_NULL_BLANK = "パスワード";
|
||||||
final String MANAGEMENT_ERROR = "管理者権限指定";
|
final String MANAGEMENT_ERROR = "管理者権限指定";
|
||||||
final String DEPARTMENT_ID_NULL_BLANK = "所属部署";
|
final String DEPARTMENT_ID_NULL_BLANK = "所属部署";
|
||||||
final String HIRE_DATE_NULL_BLANK = "入社年月日";
|
|
||||||
|
|
||||||
List<String> error = new ArrayList<>();
|
List<String> error = new ArrayList<>();
|
||||||
|
|
||||||
@@ -179,12 +173,6 @@ public class InsertEmployeeController {
|
|||||||
// エラー内容を追加
|
// エラー内容を追加
|
||||||
error.add(DEPARTMENT_ID_NULL_BLANK);
|
error.add(DEPARTMENT_ID_NULL_BLANK);
|
||||||
}
|
}
|
||||||
|
|
||||||
// null判定
|
|
||||||
if (hireDate == null) {
|
|
||||||
//エラー内容を追加
|
|
||||||
error.add(HIRE_DATE_NULL_BLANK);
|
|
||||||
}
|
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,5 @@
|
|||||||
package com.example.rhizome.app.presentation.controller;
|
package com.example.rhizome.app.presentation.controller;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
|
|
||||||
import com.example.rhizome.aop.aspect.PermissionCheck;
|
import com.example.rhizome.aop.aspect.PermissionCheck;
|
||||||
import com.example.rhizome.aop.aspect.SessionCheck;
|
import com.example.rhizome.aop.aspect.SessionCheck;
|
||||||
import com.example.rhizome.app.domain.service.SearchDepartment;
|
import com.example.rhizome.app.domain.service.SearchDepartment;
|
||||||
@@ -19,6 +7,16 @@ import com.example.rhizome.app.presentation.controller.pageproperty.PageReturnAt
|
|||||||
import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword;
|
import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword;
|
||||||
import com.example.rhizome.app.presentation.form.DepartmentForm;
|
import com.example.rhizome.app.presentation.form.DepartmentForm;
|
||||||
import com.example.rhizome.app.presentation.form.SearchConditionDepartmentForm;
|
import com.example.rhizome.app.presentation.form.SearchConditionDepartmentForm;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部署検索画面用コントローラ リスト全件表示、検索表示、更新、削除が可能
|
* 部署検索画面用コントローラ リスト全件表示、検索表示、更新、削除が可能
|
||||||
@@ -62,7 +60,7 @@ public class SelectDepartmentController {
|
|||||||
// 作成した部署一覧をセット
|
// 作成した部署一覧をセット
|
||||||
model.addAttribute(
|
model.addAttribute(
|
||||||
PageReturnAttributeKeyword.DEPARTMENT_FORM_LIST,
|
PageReturnAttributeKeyword.DEPARTMENT_FORM_LIST,
|
||||||
DepartmentForm.convertFrom(searchDepartment.searchBy(SearchConditionDepartmentForm.convertTo(searchConditionDepartmentForm)))
|
DepartmentForm.convertFrom(searchDepartment.searchByWithLike(SearchConditionDepartmentForm.convertTo(searchConditionDepartmentForm)))
|
||||||
);
|
);
|
||||||
|
|
||||||
// 検索ページに遷移
|
// 検索ページに遷移
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
package com.example.rhizome.app.presentation.form;
|
package com.example.rhizome.app.presentation.form;
|
||||||
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.Period;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 画面に表示するために employee と department を Join した構造を扱うクラス
|
* 画面に表示するために employee と department を Join した構造を扱うクラス
|
||||||
*/
|
*/
|
||||||
@@ -51,16 +48,6 @@ public class EmployeeInfoForm {
|
|||||||
* 部署名
|
* 部署名
|
||||||
*/
|
*/
|
||||||
private String nmDepartment;
|
private String nmDepartment;
|
||||||
|
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private LocalDate dateHired;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 勤続年数
|
|
||||||
*/
|
|
||||||
private String lengthOfService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* business 層の EmployeeInfo クラスから画面用(presentation 層)の EmployeeInfoForm に
|
* business 層の EmployeeInfo クラスから画面用(presentation 層)の EmployeeInfoForm に
|
||||||
@@ -70,11 +57,6 @@ public class EmployeeInfoForm {
|
|||||||
* @return クラスから画面用(presentation 層)の EmployeeInfoForm インスタンス
|
* @return クラスから画面用(presentation 層)の EmployeeInfoForm インスタンス
|
||||||
*/
|
*/
|
||||||
public static EmployeeInfoForm convertFrom(EmployeeInfo employeeInfo) {
|
public static EmployeeInfoForm convertFrom(EmployeeInfo employeeInfo) {
|
||||||
Period period = employeeInfo.getLengthOfService();
|
|
||||||
|
|
||||||
String lengthOfService =
|
|
||||||
period.getYears() + "年" + period.getMonths() + "ヵ月";
|
|
||||||
|
|
||||||
return new EmployeeInfoForm(
|
return new EmployeeInfoForm(
|
||||||
employeeInfo.getEmployee().getIdEmployee(),
|
employeeInfo.getEmployee().getIdEmployee(),
|
||||||
employeeInfo.getEmployee().getNmEmployee(),
|
employeeInfo.getEmployee().getNmEmployee(),
|
||||||
@@ -83,9 +65,7 @@ public class EmployeeInfoForm {
|
|||||||
employeeInfo.getEmployee().getPassword(),
|
employeeInfo.getEmployee().getPassword(),
|
||||||
employeeInfo.getEmployee().getAdminAuth(),
|
employeeInfo.getEmployee().getAdminAuth(),
|
||||||
employeeInfo.getDepartment().getIdDepartment(),
|
employeeInfo.getDepartment().getIdDepartment(),
|
||||||
employeeInfo.getDepartment().getNmDepartment(),
|
employeeInfo.getDepartment().getNmDepartment()
|
||||||
employeeInfo.getEmployee().getDateHired(),
|
|
||||||
lengthOfService
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
package com.example.rhizome.app.presentation.form;
|
package com.example.rhizome.app.presentation.form;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 画面から渡ってきた登録内容をまとめ、再度画面に表示する為のクラス
|
* 画面から渡ってきた登録内容をまとめ、再度画面に表示する為のクラス
|
||||||
*/
|
*/
|
||||||
@@ -54,13 +50,6 @@ public class InsertEmployeeForm {
|
|||||||
* 部署ID
|
* 部署ID
|
||||||
*/
|
*/
|
||||||
private Integer idDepartment;
|
private Integer idDepartment;
|
||||||
|
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private LocalDate dateHired;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* パスワードのValidation
|
* パスワードのValidation
|
||||||
@@ -117,8 +106,7 @@ public class InsertEmployeeForm {
|
|||||||
insertEmployeeForm.getMailAddress(),
|
insertEmployeeForm.getMailAddress(),
|
||||||
insertEmployeeForm.getPassword(),
|
insertEmployeeForm.getPassword(),
|
||||||
insertEmployeeForm.getAdminAuth(),
|
insertEmployeeForm.getAdminAuth(),
|
||||||
insertEmployeeForm.getIdDepartment(),
|
insertEmployeeForm.getIdDepartment()
|
||||||
insertEmployeeForm.getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +121,6 @@ public class InsertEmployeeForm {
|
|||||||
final String MAIL_ADDRESS_NULL_BLANK = "メールアドレス";
|
final String MAIL_ADDRESS_NULL_BLANK = "メールアドレス";
|
||||||
final String MANAGEMENT_ERROR = "管理者権限指定";
|
final String MANAGEMENT_ERROR = "管理者権限指定";
|
||||||
final String DEPARTMENT_ID_NULL_BLANK = "所属部署";
|
final String DEPARTMENT_ID_NULL_BLANK = "所属部署";
|
||||||
final String HIRE_DATE_NULL = "入社年月日";
|
|
||||||
|
|
||||||
List<String> error = new ArrayList<>();
|
List<String> error = new ArrayList<>();
|
||||||
|
|
||||||
@@ -146,9 +133,6 @@ public class InsertEmployeeForm {
|
|||||||
if (isNullOrBlank(mailAddress)) {
|
if (isNullOrBlank(mailAddress)) {
|
||||||
error.add(MAIL_ADDRESS_NULL_BLANK);
|
error.add(MAIL_ADDRESS_NULL_BLANK);
|
||||||
}
|
}
|
||||||
if(dateHired == null) {
|
|
||||||
error.add(HIRE_DATE_NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// パスワードが仕様を満たしているか確認
|
// パスワードが仕様を満たしているか確認
|
||||||
checkPassword(password, passwordConfirm, error);
|
checkPassword(password, passwordConfirm, error);
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package com.example.rhizome.app.presentation.form;
|
package com.example.rhizome.app.presentation.form;
|
||||||
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.LoginUser;
|
import com.example.rhizome.app.domain.model.LoginUser;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -43,11 +40,6 @@ public class LoginUserForm {
|
|||||||
* 部署ID
|
* 部署ID
|
||||||
*/
|
*/
|
||||||
private Integer idDepartment;
|
private Integer idDepartment;
|
||||||
|
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private LocalDate dateHired;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* business 層の LoginUser クラスから画面用(presentation 層)の LoginUserForm に
|
* business 層の LoginUser クラスから画面用(presentation 層)の LoginUserForm に
|
||||||
@@ -64,8 +56,7 @@ public class LoginUserForm {
|
|||||||
loginUser.getMailAddress(),
|
loginUser.getMailAddress(),
|
||||||
loginUser.getPassword(),
|
loginUser.getPassword(),
|
||||||
loginUser.getAdminAuth(),
|
loginUser.getAdminAuth(),
|
||||||
loginUser.getIdDepartment(),
|
loginUser.getIdDepartment()
|
||||||
loginUser.getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,8 +75,7 @@ public class LoginUserForm {
|
|||||||
loginUserForm.getMailAddress(),
|
loginUserForm.getMailAddress(),
|
||||||
loginUserForm.getPassword(),
|
loginUserForm.getPassword(),
|
||||||
loginUserForm.getAdminAuth(),
|
loginUserForm.getAdminAuth(),
|
||||||
loginUserForm.getIdDepartment(),
|
loginUserForm.getIdDepartment()
|
||||||
loginUserForm.getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
package com.example.rhizome.app.presentation.form;
|
package com.example.rhizome.app.presentation.form;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 画面から渡ってきた更新内容をまとめ、再度画面に表示する為のクラス
|
* 画面から渡ってきた更新内容をまとめ、再度画面に表示する為のクラス
|
||||||
*/
|
*/
|
||||||
@@ -50,10 +48,6 @@ public class UpdateEmployeeInfoForm {
|
|||||||
* 部署ID
|
* 部署ID
|
||||||
*/
|
*/
|
||||||
private Integer idDepartment;
|
private Integer idDepartment;
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private LocalDate dateHired;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* business 層の EmployeeInfo クラスから画面用(presentation 層)の UpdateEmployeeInfoForm に
|
* business 層の EmployeeInfo クラスから画面用(presentation 層)の UpdateEmployeeInfoForm に
|
||||||
@@ -71,8 +65,7 @@ public class UpdateEmployeeInfoForm {
|
|||||||
employeeInfo.getEmployee().getPassword(),
|
employeeInfo.getEmployee().getPassword(),
|
||||||
null,
|
null,
|
||||||
employeeInfo.getEmployee().getAdminAuth(),
|
employeeInfo.getEmployee().getAdminAuth(),
|
||||||
employeeInfo.getDepartment().getIdDepartment(),
|
employeeInfo.getDepartment().getIdDepartment()
|
||||||
employeeInfo.getEmployee().getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,8 +95,7 @@ public class UpdateEmployeeInfoForm {
|
|||||||
updateEmployeeInfoForm.getMailAddress(),
|
updateEmployeeInfoForm.getMailAddress(),
|
||||||
updateEmployeeInfoForm.getPassword(),
|
updateEmployeeInfoForm.getPassword(),
|
||||||
updateEmployeeInfoForm.getAdminAuth(),
|
updateEmployeeInfoForm.getAdminAuth(),
|
||||||
updateEmployeeInfoForm.getIdDepartment(),
|
updateEmployeeInfoForm.getIdDepartment()
|
||||||
updateEmployeeInfoForm.getDateHired()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.example.rhizome.app.presentation.form;
|
|||||||
|
|
||||||
import com.example.rhizome.app.domain.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
import com.example.rhizome.app.domain.model.LoginUser;
|
import com.example.rhizome.app.domain.model.LoginUser;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -55,7 +54,6 @@ public class UpdatePersonalUserForm {
|
|||||||
updatePersonalUserForm.getMailAddress(),
|
updatePersonalUserForm.getMailAddress(),
|
||||||
updatePersonalUserForm.getPassword(),
|
updatePersonalUserForm.getPassword(),
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,143 +3,155 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
<!-- 外部のスクリプトファイルを読み込む -->
|
<!-- 外部のスクリプトファイルを読み込む -->
|
||||||
<script th:src="@{/js/common.js}"></script>
|
<script th:src="@{/js/common.js}"></script>
|
||||||
<!-- CSSの読み込み -->
|
<!-- CSSの読み込み -->
|
||||||
<link rel="stylesheet" th:href="@{/css/all.css}">
|
<link rel="stylesheet" th:href="@{/css/all.css}">
|
||||||
<link rel=stylesheet th:href="@{/css/style.css}" type="text/css">
|
<link rel=stylesheet th:href="@{/css/style.css}" type="text/css">
|
||||||
<title>登録内容確認</title>
|
<title>登録内容確認</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>登録内容確認
|
<h1>登録内容確認
|
||||||
<div class="rightSection">
|
<div class="rightSection">
|
||||||
<span class="loginInfo">ログイン者名:<span th:text="${session.loginUser.nmEmployee}"></span></span>
|
<span class="loginInfo">ログイン者名:<span th:text="${session.loginUser.nmEmployee}"></span></span>
|
||||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<form action="insertEmployee" id="insertForm" method="post" th:object="${insertEmployeeForm}">
|
<form action="insertEmployee"
|
||||||
|
id="insertForm"
|
||||||
|
method="post"
|
||||||
|
th:object="${insertEmployeeForm}">
|
||||||
|
|
||||||
<div class="msgBox error" th:if="${messageError != null}">
|
<div class="msgBox error" th:if="${messageError != null}">
|
||||||
<span class="error" th:each="message : ${messageError.message}" th:text="${message}"></span>
|
<span class="error" th:each="message : ${messageError.message}" th:text="${message}"></span>
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="header">社員ID</th>
|
<th class="header">社員ID</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly" name="empId" readonly="readonly" type="text" value="自動で設定されます" />
|
<input class="readOnly"
|
||||||
</label>
|
name="empId"
|
||||||
</td>
|
readonly="readonly"
|
||||||
</tr>
|
type="text"
|
||||||
<tr>
|
value="自動で設定されます"/>
|
||||||
<th class="header">社員名</th>
|
</label>
|
||||||
<td>
|
</td>
|
||||||
<label>
|
</tr>
|
||||||
<input class="readOnly" name="nmEmployee" readonly="readonly" th:value="*{nmEmployee}"
|
<tr>
|
||||||
type="text" />
|
<th class="header">社員名</th>
|
||||||
</label>
|
<td>
|
||||||
</td>
|
<label>
|
||||||
</tr>
|
<input class="readOnly"
|
||||||
<tr>
|
name="nmEmployee"
|
||||||
<th class="header">社員名フリガナ</th>
|
readonly="readonly"
|
||||||
<td>
|
th:value="*{nmEmployee}"
|
||||||
<label>
|
type="text"/>
|
||||||
<input class="readOnly" name="knEmployee" readonly="readonly" th:value="*{knEmployee}"
|
</label>
|
||||||
type="text" />
|
</td>
|
||||||
</label>
|
</tr>
|
||||||
</td>
|
<tr>
|
||||||
</tr>
|
<th class="header">社員名フリガナ</th>
|
||||||
<tr>
|
<td>
|
||||||
<th class="header">メールアドレス</th>
|
<label>
|
||||||
<td>
|
<input class="readOnly"
|
||||||
<label>
|
name="knEmployee"
|
||||||
<input class="readOnly" name="mailAddress" readonly="readonly" th:value="*{mailAddress}"
|
readonly="readonly"
|
||||||
type="text" />
|
th:value="*{knEmployee}"
|
||||||
</label>
|
type="text"/>
|
||||||
</td>
|
</label>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<th class="header">パスワード</th>
|
<tr>
|
||||||
<td>
|
<th class="header">メールアドレス</th>
|
||||||
<label>
|
<td>
|
||||||
<input class="readOnly" name="password" readonly="readonly" th:value="*{password}"
|
<label>
|
||||||
type="password" />
|
<input class="readOnly"
|
||||||
</label>
|
name="mailAddress"
|
||||||
</td>
|
readonly="readonly"
|
||||||
</tr>
|
th:value="*{mailAddress}"
|
||||||
<tr>
|
type="text"/>
|
||||||
<th class="header">管理者権限</th>
|
</label>
|
||||||
<td>
|
</td>
|
||||||
<label>
|
</tr>
|
||||||
<input id="adminAuth1" name="adminAuth" onclick="return false;"
|
<tr>
|
||||||
th:checked="${insertEmployeeForm .adminAuth == 1}" type="radio" value="1"> 管理者権限
|
<th class="header">パスワード</th>
|
||||||
</label>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input id="adminAuth0" name="adminAuth" onclick="return false;"
|
<input class="readOnly"
|
||||||
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
name="password"
|
||||||
type="radio" value="0">
|
readonly="readonly"
|
||||||
一般権限
|
th:value="*{password}"
|
||||||
</label>
|
type="password"/>
|
||||||
</td>
|
</label>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<th class="header">所属部署</th>
|
<tr>
|
||||||
<td>
|
<th class="header">管理者権限</th>
|
||||||
<label>
|
<td>
|
||||||
<select name="idDepartment" required="required" th:field="*{idDepartment}">
|
<label>
|
||||||
<th:block th:each="department : ${departmentFormList}">
|
<input id="adminAuth1" name="adminAuth" onclick="return false;"
|
||||||
<th:block
|
th:checked="${insertEmployeeForm .adminAuth == 1}" type="radio"
|
||||||
th:if="${insertEmployeeForm.idDepartment != null && department.idDepartment == insertEmployeeForm.idDepartment}">
|
value="1"> 管理者権限
|
||||||
<option th:text="${department.nmDepartment}" th:value="${department.idDepartment}">
|
</label>
|
||||||
</option>
|
<label>
|
||||||
</th:block>
|
<input id="adminAuth0" name="adminAuth" onclick="return false;"
|
||||||
</th:block>
|
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
||||||
</select>
|
type="radio"
|
||||||
</label>
|
value="0">
|
||||||
</td>
|
一般権限
|
||||||
</tr>
|
</label>
|
||||||
<tr>
|
</td>
|
||||||
<th class="header">入社年月日</th>
|
</tr>
|
||||||
<td>
|
<tr>
|
||||||
<label>
|
<th class="header">所属部署</th>
|
||||||
<input class="readOnly" name="dateHired" readonly="readonly" th:value="*{dateHired}"
|
<td>
|
||||||
type="text" />
|
<label>
|
||||||
</label>
|
<select name="idDepartment" required="required" th:field="*{idDepartment}">
|
||||||
</td>
|
<th:block th:each="department : ${departmentFormList}">
|
||||||
</tr>
|
<th:block
|
||||||
<tr>
|
th:if="${insertEmployeeForm.idDepartment != null && department.idDepartment == insertEmployeeForm.idDepartment}">
|
||||||
<td class="btnArea" colspan="2">
|
<option th:text="${department.nmDepartment}"
|
||||||
<input type="submit" value="登録" />
|
th:value="${department.idDepartment}">
|
||||||
</td>
|
</option>
|
||||||
</tr>
|
</th:block>
|
||||||
</table>
|
</th:block>
|
||||||
<a href="javascript:onClickEdit()">登録内容の編集</a> | <a href="showMenu">メニューに戻る</a>
|
</select>
|
||||||
</form>
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="btnArea" colspan="2">
|
||||||
|
<input type="submit" value="登録"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<a href="javascript:onClickEdit()">登録内容の編集</a> | <a href="showMenu">メニューに戻る</a>
|
||||||
|
</form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function onClickEdit() {
|
function onClickEdit() {
|
||||||
const form = document.getElementById('insertForm');
|
const form = document.getElementById('insertForm');
|
||||||
form.setAttribute('method', 'post');
|
form.setAttribute('method', 'post');
|
||||||
form.setAttribute('action', 'insertEmployeeInput');
|
form.setAttribute('action', 'insertEmployeeInput');
|
||||||
|
|
||||||
// 確認画面から編集画面に戻ってきたときのフラグ(未使用)
|
// 確認画面から編集画面に戻ってきたときのフラグ(未使用)
|
||||||
const inputField = document.createElement("input");
|
const inputField = document.createElement("input");
|
||||||
inputField.setAttribute("type", "hidden");
|
inputField.setAttribute("type", "hidden");
|
||||||
inputField.setAttribute("name", "backFlg");
|
inputField.setAttribute("name", "backFlg");
|
||||||
inputField.setAttribute("value", "edit");
|
inputField.setAttribute("value", "edit");
|
||||||
|
|
||||||
form.appendChild(inputField);
|
form.appendChild(inputField);
|
||||||
|
|
||||||
// フォームをDOMに追加
|
// フォームをDOMに追加
|
||||||
document.body.appendChild(form);
|
document.body.appendChild(form);
|
||||||
|
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -3,135 +3,156 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
<!-- 外部のスクリプトファイルを読み込む -->
|
<!-- 外部のスクリプトファイルを読み込む -->
|
||||||
<script th:src="@{/js/common.js}"></script>
|
<script th:src="@{/js/common.js}"></script>
|
||||||
<!-- CSSの読み込み -->
|
<!-- CSSの読み込み -->
|
||||||
<link rel="stylesheet" th:href="@{/css/all.css}">
|
<link rel="stylesheet" th:href="@{/css/all.css}">
|
||||||
<link rel=stylesheet th:href="@{/css/style.css}" type="text/css">
|
<link rel=stylesheet th:href="@{/css/style.css}" type="text/css">
|
||||||
<title>社員登録</title>
|
<title>社員登録</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>
|
<h1>
|
||||||
社員登録
|
社員登録
|
||||||
<div class="rightSection">
|
<div class="rightSection">
|
||||||
<span class="loginInfo">ログイン者名:<span th:text="${session.loginUser.nmEmployee}"></span></span>
|
<span class="loginInfo">ログイン者名:<span th:text="${session.loginUser.nmEmployee}"></span></span>
|
||||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
<form action="insertEmployeeConfirm" method="post" th:object="${insertEmployeeForm}">
|
<form action="insertEmployeeConfirm"
|
||||||
|
method="post"
|
||||||
|
th:object="${insertEmployeeForm}">
|
||||||
|
|
||||||
<div class="msgBox error" th:if="${messageError} != null">
|
<div class="msgBox error" th:if="${messageError} != null">
|
||||||
<span class="error" th:text="${messageError.message}"></span>
|
<span class="error" th:text="${messageError.message}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="header">社員ID</th>
|
<th class="header">社員ID</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly" readonly="readonly" type="text" value="自動で設定されます" />
|
<input class="readOnly"
|
||||||
</label>
|
readonly="readonly"
|
||||||
</td>
|
type="text"
|
||||||
</tr>
|
value="自動で設定されます"
|
||||||
<tr>
|
/>
|
||||||
<th class="header">社員名</th>
|
</label>
|
||||||
<td>
|
</td>
|
||||||
<label>
|
</tr>
|
||||||
<input maxlength="50" placeholder="社員名" required="required" th:field="*{nmEmployee}"
|
<tr>
|
||||||
type="text" />
|
<th class="header">社員名</th>
|
||||||
</label>
|
<td>
|
||||||
</td>
|
<label>
|
||||||
</tr>
|
<input maxlength="50"
|
||||||
<tr>
|
placeholder="社員名"
|
||||||
<th class="header">社員名フリガナ</th>
|
required="required"
|
||||||
<td>
|
th:field="*{nmEmployee}"
|
||||||
<label>
|
type="text"
|
||||||
<input maxlength="50" oninput="convertToKatakana(this)" placeholder="フリガナ" required="required"
|
/>
|
||||||
th:field="*{knEmployee}" type="text" />
|
</label>
|
||||||
</label>
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th class="header">社員名フリガナ</th>
|
||||||
<th class="header">メールアドレス</th>
|
<td>
|
||||||
<td>
|
<label>
|
||||||
<label>
|
<input maxlength="50"
|
||||||
<input maxlength="100" placeholder="メールアドレス" required="required" th:field="*{mailAddress}"
|
oninput="convertToKatakana(this)"
|
||||||
type="email" />
|
placeholder="フリガナ"
|
||||||
</label>
|
required="required"
|
||||||
</td>
|
th:field="*{knEmployee}"
|
||||||
</tr>
|
type="text"
|
||||||
<tr>
|
/>
|
||||||
<th class="header">パスワード</th>
|
</label>
|
||||||
<td>
|
</td>
|
||||||
<label>
|
</tr>
|
||||||
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$" placeholder="パスワード"
|
<tr>
|
||||||
required="required" th:field="*{password}" type="password" />
|
<th class="header">メールアドレス</th>
|
||||||
</label>
|
<td>
|
||||||
</td>
|
<label>
|
||||||
</tr>
|
<input maxlength="100"
|
||||||
<!-- *** Chrome等のブラウザの場合自動でセットされる可能性があるので注意書きを外にも *** -->
|
placeholder="メールアドレス"
|
||||||
<tr>
|
required="required"
|
||||||
<th></th>
|
th:field="*{mailAddress}"
|
||||||
<td><span style="font-size:8pt; font-weight:bold; color:red;">※半角英数字をそれぞれ1種類以上含む3-10文字</span>
|
type="email"
|
||||||
</td>
|
/>
|
||||||
</tr>
|
</label>
|
||||||
<tr>
|
</td>
|
||||||
<th class="header">パスワード確認用</th>
|
</tr>
|
||||||
<td>
|
<tr>
|
||||||
<label>
|
<th class="header">パスワード</th>
|
||||||
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$" placeholder="パスワード確認用"
|
<td>
|
||||||
required="required" th:field="*{passwordConfirm}" type="password" />
|
<label>
|
||||||
</label>
|
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$"
|
||||||
</td>
|
placeholder="パスワード"
|
||||||
</tr>
|
required="required"
|
||||||
<tr>
|
th:field="*{password}"
|
||||||
<th class="header">管理者権限</th>
|
type="password"
|
||||||
<td>
|
/>
|
||||||
<label>
|
</label>
|
||||||
<input id="adminAuth1" name="adminAuth" th:checked="${insertEmployeeForm .adminAuth == 1}"
|
</td>
|
||||||
type="radio" value="1"> 管理者権限
|
</tr>
|
||||||
</label>
|
<!-- *** Chrome等のブラウザの場合自動でセットされる可能性があるので注意書きを外にも *** -->
|
||||||
<label>
|
<tr>
|
||||||
<input id="adminAuth0" name="adminAuth"
|
<th></th>
|
||||||
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
<td><span
|
||||||
type="radio" value="0">
|
style="font-size:8pt; font-weight:bold; color:red;">※半角英数字をそれぞれ1種類以上含む3-10文字</span>
|
||||||
一般権限
|
</td>
|
||||||
</label>
|
</tr>
|
||||||
</td>
|
<tr>
|
||||||
</tr>
|
<th class="header">パスワード確認用</th>
|
||||||
|
<td>
|
||||||
|
<label>
|
||||||
|
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$"
|
||||||
|
placeholder="パスワード確認用"
|
||||||
|
required="required"
|
||||||
|
th:field="*{passwordConfirm}"
|
||||||
|
type="password"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="header">管理者権限</th>
|
||||||
|
<td>
|
||||||
|
<label>
|
||||||
|
<input id="adminAuth1" name="adminAuth" th:checked="${insertEmployeeForm .adminAuth == 1}"
|
||||||
|
type="radio"
|
||||||
|
value="1"> 管理者権限
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<input id="adminAuth0" name="adminAuth"
|
||||||
|
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
||||||
|
type="radio"
|
||||||
|
value="0">
|
||||||
|
一般権限
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th class="header">所属部署</th>
|
<th class="header">所属部署</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<select required="required" th:field="*{idDepartment}">
|
<select required="required" th:field="*{idDepartment}">
|
||||||
<option th:each="department : ${departmentFormList}"
|
<option th:each="department : ${departmentFormList}"
|
||||||
th:selected="${insertEmployeeForm.idDepartment != null && department.idDepartment == insertEmployeeForm.idDepartment}"
|
th:selected="${insertEmployeeForm.idDepartment != null && department.idDepartment == insertEmployeeForm.idDepartment}"
|
||||||
th:text="${department.nmDepartment}" th:value="${department.idDepartment}">
|
th:text="${department.nmDepartment}"
|
||||||
</option>
|
th:value="${department.idDepartment}">
|
||||||
</select>
|
</option>
|
||||||
</label>
|
</select>
|
||||||
</td>
|
</label>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<th class="header">入社年月日</th>
|
<tr>
|
||||||
<td>
|
<td class="btnArea" colspan="2">
|
||||||
<label>
|
<input type="submit" value="登録確認"/>
|
||||||
<input required="required" th:field="*{dateHired}"
|
</td>
|
||||||
type="date" />
|
</tr>
|
||||||
</label>
|
</table>
|
||||||
</td>
|
</form>
|
||||||
</tr>
|
<a href="showMenu">メニューに戻る</a>
|
||||||
<tr>
|
|
||||||
<td class="btnArea" colspan="2">
|
|
||||||
<input type="submit" value="登録確認" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
<a href="showMenu">メニューに戻る</a>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -107,9 +107,7 @@
|
|||||||
<th style="width: 100px;">パスワード</th>
|
<th style="width: 100px;">パスワード</th>
|
||||||
<th style="width: 70px;">管理者フラグ</th>
|
<th style="width: 70px;">管理者フラグ</th>
|
||||||
<th style="width: 150px;">所属部署</th>
|
<th style="width: 150px;">所属部署</th>
|
||||||
<th style="width: 80px;">入社年月日</th>
|
<th style="width: 150px;">操作</th>
|
||||||
<th style="width: 80px;">勤続年数</th>
|
|
||||||
<th style="width: 100px;">操作</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -121,8 +119,6 @@
|
|||||||
<td th:text="${employeeInfoForm.password}"></td>
|
<td th:text="${employeeInfoForm.password}"></td>
|
||||||
<td th:text="${employeeInfoForm.adminAuth}"></td>
|
<td th:text="${employeeInfoForm.adminAuth}"></td>
|
||||||
<td th:text="${employeeInfoForm.nmDepartment}"></td>
|
<td th:text="${employeeInfoForm.nmDepartment}"></td>
|
||||||
<td th:text="${employeeInfoForm.dateHired}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.lengthOfService}"></td>
|
|
||||||
<td>
|
<td>
|
||||||
<!-- 更新フォーム -->
|
<!-- 更新フォーム -->
|
||||||
<form action="showUpdateEmployee" method="post" style="display: inline;">
|
<form action="showUpdateEmployee" method="post" style="display: inline;">
|
||||||
|
|||||||
BIN
【機能改修01_組織の階層化】/【組織の階層構造導入】基本設計書.xlsx
Normal file
BIN
【機能改修01_組織の階層化】/【組織の階層構造導入】基本設計書.xlsx
Normal file
Binary file not shown.
BIN
【機能改修01_組織の階層化】/【組織の階層構造導入】要件定義.docx
Normal file
BIN
【機能改修01_組織の階層化】/【組織の階層構造導入】要件定義.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
設計書/テーブル定義書.xlsm
BIN
設計書/テーブル定義書.xlsm
Binary file not shown.
Reference in New Issue
Block a user