Compare commits
8 Commits
14c1f9521c
...
y-okumura
| Author | SHA1 | Date | |
|---|---|---|---|
| 220f35c677 | |||
| 9bd0e21635 | |||
| 15c8303c0d | |||
| 50f7a477e4 | |||
| 97a6138814 | |||
| 9615afffa2 | |||
|
|
b4ae39c587 | ||
| cd78bee91f |
@@ -59,6 +59,8 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.30</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
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;
|
||||||
|
|
||||||
@@ -29,10 +31,6 @@ public class Employee {
|
|||||||
* パスワード
|
* パスワード
|
||||||
*/
|
*/
|
||||||
private final String password;
|
private final String password;
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private final String hireDate;
|
|
||||||
/**
|
/**
|
||||||
* 管理者権限
|
* 管理者権限
|
||||||
*/
|
*/
|
||||||
@@ -41,5 +39,9 @@ public class Employee {
|
|||||||
* 部署ID
|
* 部署ID
|
||||||
*/
|
*/
|
||||||
private final Integer idDepartment;
|
private final Integer idDepartment;
|
||||||
|
/**
|
||||||
|
* 入社年月日
|
||||||
|
*/
|
||||||
|
private final LocalDate dateHired;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
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;
|
||||||
|
|
||||||
@@ -25,4 +27,9 @@ public class EmployeeInfo {
|
|||||||
*/
|
*/
|
||||||
private final Department department;
|
private final Department department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勤続年数
|
||||||
|
*/
|
||||||
|
private final Period lengthOfService;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
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;
|
||||||
|
|
||||||
@@ -40,6 +42,11 @@ public class LoginUser {
|
|||||||
*/
|
*/
|
||||||
private final Integer idDepartment;
|
private final Integer idDepartment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入社年月日
|
||||||
|
*/
|
||||||
|
private final LocalDate dateHired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ログインユーザが管理者か
|
* ログインユーザが管理者か
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
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) 検索系の機能を集約させるサービスクラスです
|
||||||
@@ -26,7 +30,6 @@ public class SearchEmployeeInfoImpl implements SearchEmployeeInfo {
|
|||||||
this.employeeInfoRepository = employeeInfoRepository;
|
this.employeeInfoRepository = employeeInfoRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EmployeeInfo (employee join department) のレコードを全件取得
|
* EmployeeInfo (employee join department) のレコードを全件取得
|
||||||
*
|
*
|
||||||
@@ -34,7 +37,14 @@ public class SearchEmployeeInfoImpl implements SearchEmployeeInfo {
|
|||||||
*/
|
*/
|
||||||
public List<EmployeeInfo> selectAll() {
|
public List<EmployeeInfo> selectAll() {
|
||||||
|
|
||||||
return EmployeeDepartmentEntity.createEmployeeInfoList(employeeInfoRepository.findAll());
|
List<EmployeeDepartmentEntity> entityList = employeeInfoRepository.findAll();
|
||||||
|
List<Period> lengthOfServiceList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (EmployeeDepartmentEntity entity : entityList) {
|
||||||
|
lengthOfServiceList.add(Period.between(entity.getDateHired(), LocalDate.now()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return EmployeeDepartmentEntity.createEmployeeInfoList(entityList, lengthOfServiceList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,16 +57,21 @@ public class SearchEmployeeInfoImpl implements SearchEmployeeInfo {
|
|||||||
public List<EmployeeInfo> searchBy(SearchConditionEmployee searchConditionEmployee) {
|
public List<EmployeeInfo> searchBy(SearchConditionEmployee searchConditionEmployee) {
|
||||||
// 動的に検索条件を絞り込む
|
// 動的に検索条件を絞り込む
|
||||||
// Specification は Criteria API の Predicate をラップしたもの
|
// Specification は Criteria API の Predicate をラップしたもの
|
||||||
return EmployeeDepartmentEntity
|
List<EmployeeDepartmentEntity> entityList = employeeInfoRepository.findAll(Specification
|
||||||
.createEmployeeInfoList(
|
|
||||||
employeeInfoRepository.findAll(Specification
|
|
||||||
.where(EmployeeInfoRepository.idEmployeeEqual(searchConditionEmployee.getIdEmployee()))
|
.where(EmployeeInfoRepository.idEmployeeEqual(searchConditionEmployee.getIdEmployee()))
|
||||||
.and(EmployeeInfoRepository.nmEmployeeEqual(searchConditionEmployee.getNmEmployee()))
|
.and(EmployeeInfoRepository.nmEmployeeEqual(searchConditionEmployee.getNmEmployee()))
|
||||||
.and(EmployeeInfoRepository.knEmployeeEqual(searchConditionEmployee.getKnEmployee()))
|
.and(EmployeeInfoRepository.knEmployeeEqual(searchConditionEmployee.getKnEmployee()))
|
||||||
.and(EmployeeInfoRepository.mailAddressEqual(searchConditionEmployee.getMailAddress()))
|
.and(EmployeeInfoRepository.mailAddressEqual(searchConditionEmployee.getMailAddress()))
|
||||||
.and(EmployeeInfoRepository.idDepartmentEqual(searchConditionEmployee.getIdDepartment()))
|
.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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ public class UpdateEmployeeImpl implements UpdateEmployee {
|
|||||||
updateEmployee.getKnEmployee(),
|
updateEmployee.getKnEmployee(),
|
||||||
updateEmployee.getMailAddress(),
|
updateEmployee.getMailAddress(),
|
||||||
updateEmployee.getPassword().isBlank() ? beforeEmployee.getPassword() : updateEmployee.getPassword(),
|
updateEmployee.getPassword().isBlank() ? beforeEmployee.getPassword() : updateEmployee.getPassword(),
|
||||||
updateEmployee.getHireDate(),
|
|
||||||
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,6 +1,9 @@
|
|||||||
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.List;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -71,12 +74,6 @@ public class EmployeeDepartmentEntity {
|
|||||||
@Column(name = "password", nullable = false)
|
@Column(name = "password", nullable = false)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
@Column(name = "hire_date", nullable = false)
|
|
||||||
private String hireDate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理者権限
|
* 管理者権限
|
||||||
*/
|
*/
|
||||||
@@ -88,14 +85,20 @@ public class EmployeeDepartmentEntity {
|
|||||||
@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) {
|
public static EmployeeInfo createEmployeeInfo(EmployeeDepartmentEntity employeeDepartmentEntity, Period lengthOfService) {
|
||||||
|
|
||||||
// コンストラクタを使って書くとSetterを使用するより簡略化出来ます。
|
// コンストラクタを使って書くとSetterを使用するより簡略化出来ます。
|
||||||
// 混乱してしまう人は落ち着いて EmployeeInfo のフィールドを見に行って、
|
// 混乱してしまう人は落ち着いて EmployeeInfo のフィールドを見に行って、
|
||||||
@@ -107,13 +110,15 @@ public class EmployeeDepartmentEntity {
|
|||||||
employeeDepartmentEntity.getKnEmployee(),
|
employeeDepartmentEntity.getKnEmployee(),
|
||||||
employeeDepartmentEntity.getMailAddress(),
|
employeeDepartmentEntity.getMailAddress(),
|
||||||
employeeDepartmentEntity.getPassword(),
|
employeeDepartmentEntity.getPassword(),
|
||||||
employeeDepartmentEntity.getHireDate(),
|
|
||||||
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
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -123,14 +128,25 @@ public class EmployeeDepartmentEntity {
|
|||||||
* (リスト版)
|
* (リスト版)
|
||||||
*
|
*
|
||||||
* @param employeeDepartmentEntityList EmployeeDepartmentEntity インスタンスのリスト
|
* @param employeeDepartmentEntityList EmployeeDepartmentEntity インスタンスのリスト
|
||||||
|
* @param 勤続年数のリスト
|
||||||
* @return EmployeeInfo インスタンスのリスト
|
* @return EmployeeInfo インスタンスのリスト
|
||||||
*/
|
*/
|
||||||
public static List<EmployeeInfo> createEmployeeInfoList(List<EmployeeDepartmentEntity> employeeDepartmentEntityList) {
|
public static List<EmployeeInfo> createEmployeeInfoList(
|
||||||
|
List<EmployeeDepartmentEntity> employeeDepartmentEntityList,
|
||||||
|
List<Period> lengthOfServiceList) {
|
||||||
|
|
||||||
// StreamAPI を使うとこうなります。
|
if (employeeDepartmentEntityList.size() != lengthOfServiceList.size()) {
|
||||||
return employeeDepartmentEntityList.stream().map(EmployeeDepartmentEntity::createEmployeeInfo).toList();
|
throw new IllegalArgumentException(
|
||||||
|
"社員情報と勤続年数の件数が一致しません。");
|
||||||
|
}
|
||||||
|
|
||||||
|
return IntStream.range(0, employeeDepartmentEntityList.size())
|
||||||
|
.mapToObj(index -> EmployeeDepartmentEntity
|
||||||
|
.createEmployeeInfo(employeeDepartmentEntityList.get(index), lengthOfServiceList.get(index)))
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
package com.example.rhizome.app.infra.entity;
|
package com.example.rhizome.app.infra.entity;
|
||||||
|
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@@ -68,11 +69,6 @@ public class EmployeeEntity {
|
|||||||
@Column(name = "password", nullable = false)
|
@Column(name = "password", nullable = false)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
@Column(name = "hire_Date", nullable = false)
|
|
||||||
private String hireDate;
|
|
||||||
/**
|
/**
|
||||||
* 管理者権限
|
* 管理者権限
|
||||||
*/
|
*/
|
||||||
@@ -85,6 +81,11 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,9 +102,9 @@ public class EmployeeEntity {
|
|||||||
employee.getKnEmployee(),
|
employee.getKnEmployee(),
|
||||||
employee.getMailAddress(),
|
employee.getMailAddress(),
|
||||||
employee.getPassword(),
|
employee.getPassword(),
|
||||||
employee.getHireDate(),
|
|
||||||
employee.getAdminAuth(),
|
employee.getAdminAuth(),
|
||||||
employee.getIdDepartment()
|
employee.getIdDepartment(),
|
||||||
|
employee.getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,9 +143,9 @@ public class EmployeeEntity {
|
|||||||
employeeEntity.getKnEmployee(),
|
employeeEntity.getKnEmployee(),
|
||||||
employeeEntity.getMailAddress(),
|
employeeEntity.getMailAddress(),
|
||||||
employeeEntity.getPassword(),
|
employeeEntity.getPassword(),
|
||||||
employeeEntity.getHireDate(),
|
|
||||||
employeeEntity.getAdminAuth(),
|
employeeEntity.getAdminAuth(),
|
||||||
employeeEntity.getIdDepartment()
|
employeeEntity.getIdDepartment(),
|
||||||
|
employeeEntity.getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +183,8 @@ public class EmployeeEntity {
|
|||||||
getMailAddress(),
|
getMailAddress(),
|
||||||
getPassword(),
|
getPassword(),
|
||||||
getAdminAuth(),
|
getAdminAuth(),
|
||||||
getIdDepartment()
|
getIdDepartment(),
|
||||||
|
getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.example.rhizome.app.presentation.controller;
|
|||||||
|
|
||||||
import static com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword.*;
|
import static com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@@ -83,9 +84,9 @@ public class InsertEmployeeController {
|
|||||||
insertEmployeeForm.getKnEmployee(),
|
insertEmployeeForm.getKnEmployee(),
|
||||||
insertEmployeeForm.getMailAddress(),
|
insertEmployeeForm.getMailAddress(),
|
||||||
insertEmployeeForm.getPassword(),
|
insertEmployeeForm.getPassword(),
|
||||||
insertEmployeeForm.getHireDate(),
|
|
||||||
insertEmployeeForm.getAdminAuth(),
|
insertEmployeeForm.getAdminAuth(),
|
||||||
insertEmployeeForm.getIdDepartment()
|
insertEmployeeForm.getIdDepartment(),
|
||||||
|
insertEmployeeForm.getDateHired()
|
||||||
);
|
);
|
||||||
|
|
||||||
// エラーが1件以上有る場合
|
// エラーが1件以上有る場合
|
||||||
@@ -128,18 +129,18 @@ public class InsertEmployeeController {
|
|||||||
String employeeKana,
|
String employeeKana,
|
||||||
String mailAddress,
|
String mailAddress,
|
||||||
String password,
|
String password,
|
||||||
String hireDate,
|
|
||||||
Integer management,
|
Integer management,
|
||||||
Integer departmentId
|
Integer departmentId,
|
||||||
|
LocalDate hireDate
|
||||||
) {
|
) {
|
||||||
|
|
||||||
final String EMPLOYEE_NAME_NULL_BLANK = "社員名";
|
final String EMPLOYEE_NAME_NULL_BLANK = "社員名";
|
||||||
final String EMPLOYEE_KANA_NULL_BLANK = "社員名フリガナ";
|
final String EMPLOYEE_KANA_NULL_BLANK = "社員名フリガナ";
|
||||||
final String MAIL_ADDRESS_NULL_BLANK = "メールアドレス";
|
final String MAIL_ADDRESS_NULL_BLANK = "メールアドレス";
|
||||||
final String PASSWORD_NULL_BLANK = "パスワード";
|
final String PASSWORD_NULL_BLANK = "パスワード";
|
||||||
final String HIREDATE_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<>();
|
||||||
|
|
||||||
@@ -166,11 +167,6 @@ public class InsertEmployeeController {
|
|||||||
// エラー内容を追加
|
// エラー内容を追加
|
||||||
error.add(PASSWORD_NULL_BLANK);
|
error.add(PASSWORD_NULL_BLANK);
|
||||||
}
|
}
|
||||||
// null or 空文字判定
|
|
||||||
if (isNullOrBlank(hireDate)) {
|
|
||||||
// エラー内容を追加
|
|
||||||
error.add(HIREDATE_NULL_BLANK);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 管理者権限の値が不正か
|
// 管理者権限の値が不正か
|
||||||
if (management == null) {
|
if (management == null) {
|
||||||
@@ -184,6 +180,12 @@ 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,11 +1,14 @@
|
|||||||
package com.example.rhizome.app.presentation.controller;
|
package com.example.rhizome.app.presentation.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import com.example.rhizome.aop.aspect.PermissionCheck;
|
||||||
import java.util.logging.Level;
|
import com.example.rhizome.aop.aspect.SessionCheck;
|
||||||
import java.util.logging.Logger;
|
import com.example.rhizome.app.domain.service.SearchDepartment;
|
||||||
|
import com.example.rhizome.app.domain.service.SearchEmployeeInfo;
|
||||||
import javax.servlet.http.HttpSession;
|
import com.example.rhizome.app.presentation.controller.pageproperty.PageReturnAttributeKeyword;
|
||||||
|
import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword;
|
||||||
|
import com.example.rhizome.app.presentation.form.DepartmentForm;
|
||||||
|
import com.example.rhizome.app.presentation.form.EmployeeInfoForm;
|
||||||
|
import com.example.rhizome.app.presentation.form.SearchConditionEmployeeForm;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
@@ -13,16 +16,9 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
import com.example.rhizome.aop.aspect.PermissionCheck;
|
import javax.servlet.http.HttpSession;
|
||||||
import com.example.rhizome.aop.aspect.SessionCheck;
|
import java.util.logging.Level;
|
||||||
import com.example.rhizome.app.domain.service.SearchDepartment;
|
import java.util.logging.Logger;
|
||||||
import com.example.rhizome.app.domain.service.SearchEmployeeInfo;
|
|
||||||
import com.example.rhizome.app.domain.service.TenureCalc;
|
|
||||||
import com.example.rhizome.app.presentation.controller.pageproperty.PageReturnAttributeKeyword;
|
|
||||||
import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword;
|
|
||||||
import com.example.rhizome.app.presentation.form.DepartmentForm;
|
|
||||||
import com.example.rhizome.app.presentation.form.EmployeeInfoForm;
|
|
||||||
import com.example.rhizome.app.presentation.form.SearchConditionEmployeeForm;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社員検索画面用コントローラ リスト全件表示、検索表示、更新、削除が可能
|
* 社員検索画面用コントローラ リスト全件表示、検索表示、更新、削除が可能
|
||||||
@@ -38,13 +34,12 @@ public class SelectEmployeeController {
|
|||||||
HttpSession httpSession;
|
HttpSession httpSession;
|
||||||
SearchDepartment searchDepartment;
|
SearchDepartment searchDepartment;
|
||||||
SearchEmployeeInfo searchEmployeeInfo;
|
SearchEmployeeInfo searchEmployeeInfo;
|
||||||
TenureCalc tenureCalc;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public SelectEmployeeController(HttpSession httpSession, SearchDepartment searchDepartment, SearchEmployeeInfo searchEmployeeInfo ,TenureCalc tenureCalc) {
|
public SelectEmployeeController(HttpSession httpSession, SearchDepartment searchDepartment, SearchEmployeeInfo searchEmployeeInfo) {
|
||||||
this.httpSession = httpSession;
|
this.httpSession = httpSession;
|
||||||
this.searchDepartment = searchDepartment;
|
this.searchDepartment = searchDepartment;
|
||||||
this.searchEmployeeInfo = searchEmployeeInfo;
|
this.searchEmployeeInfo = searchEmployeeInfo;
|
||||||
this.tenureCalc = tenureCalc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModelAttribute
|
@ModelAttribute
|
||||||
@@ -75,14 +70,7 @@ public class SelectEmployeeController {
|
|||||||
|
|
||||||
// 検索条件を元に検索を実施
|
// 検索条件を元に検索を実施
|
||||||
// 取得した EmployeeInfo( employee + department )の情報を画面に返す用の型に詰め替えてセット
|
// 取得した EmployeeInfo( employee + department )の情報を画面に返す用の型に詰め替えてセット
|
||||||
|
model.addAttribute(PageReturnAttributeKeyword.EMPLOYEE_INFO_FORM_LIST, EmployeeInfoForm.convertFrom(searchEmployeeInfo.searchBy(SearchConditionEmployeeForm.convertTo(searchConditionEmployeeForm))));
|
||||||
List<EmployeeInfoForm>employeeInfoForm = EmployeeInfoForm.convertFrom(searchEmployeeInfo.searchBy(SearchConditionEmployeeForm.convertTo(searchConditionEmployeeForm)));
|
|
||||||
for(EmployeeInfoForm form:employeeInfoForm) {
|
|
||||||
String tenure = tenureCalc.tenureCalc(form.getHireDate());
|
|
||||||
form.setTenure(tenure);
|
|
||||||
}
|
|
||||||
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.EMPLOYEE_INFO_FORM_LIST, employeeInfoForm);
|
|
||||||
// 検索ページに遷移
|
// 検索ページに遷移
|
||||||
return TransitionTargetPageNameKeyword.SELECT_EMPLOYEE_HTML;
|
return TransitionTargetPageNameKeyword.SELECT_EMPLOYEE_HTML;
|
||||||
|
|
||||||
@@ -121,16 +109,11 @@ public class SelectEmployeeController {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 検索条件を元に検索を実施
|
// 検索条件を元に検索を実施
|
||||||
List<EmployeeInfoForm>employeeInfoForm =EmployeeInfoForm.convertFrom(
|
model.addAttribute(PageReturnAttributeKeyword.EMPLOYEE_INFO_FORM_LIST,
|
||||||
|
EmployeeInfoForm.convertFrom(
|
||||||
searchEmployeeInfo.searchBy(
|
searchEmployeeInfo.searchBy(
|
||||||
SearchConditionEmployeeForm.convertTo(searchConditionEmployeeForm())
|
SearchConditionEmployeeForm.convertTo(searchConditionEmployeeForm())
|
||||||
));
|
)));
|
||||||
for(EmployeeInfoForm form:employeeInfoForm) {
|
|
||||||
String tenure = tenureCalc.tenureCalc(form.getHireDate());
|
|
||||||
form.setTenure(tenure);
|
|
||||||
}
|
|
||||||
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.EMPLOYEE_INFO_FORM_LIST,employeeInfoForm);
|
|
||||||
|
|
||||||
// 検索ページに遷移
|
// 検索ページに遷移
|
||||||
return TransitionTargetPageNameKeyword.SELECT_EMPLOYEE_HTML;
|
return TransitionTargetPageNameKeyword.SELECT_EMPLOYEE_HTML;
|
||||||
|
|||||||
@@ -1,20 +1,6 @@
|
|||||||
package com.example.rhizome.app.presentation.controller;
|
package com.example.rhizome.app.presentation.controller;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
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.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
@@ -29,6 +15,18 @@ import com.example.rhizome.app.presentation.form.DepartmentForm;
|
|||||||
import com.example.rhizome.app.presentation.form.LoginUserForm;
|
import com.example.rhizome.app.presentation.form.LoginUserForm;
|
||||||
import com.example.rhizome.app.presentation.form.MessageForm;
|
import com.example.rhizome.app.presentation.form.MessageForm;
|
||||||
import com.example.rhizome.app.presentation.form.UpdateEmployeeInfoForm;
|
import com.example.rhizome.app.presentation.form.UpdateEmployeeInfoForm;
|
||||||
|
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.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* employee を更新して結果を返す為のコントローラ
|
* employee を更新して結果を返す為のコントローラ
|
||||||
@@ -150,10 +148,7 @@ public class UpdateEmployeeResultController {
|
|||||||
return TransitionTargetPageNameKeyword.UPDATE_EMPLOYEE_INPUT_HTML;
|
return TransitionTargetPageNameKeyword.UPDATE_EMPLOYEE_INPUT_HTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEmployeeInfoForm.setHireDate(beforeEmployee.getHireDate());
|
|
||||||
|
|
||||||
// 画面用の型からビジネスロジック用のモデルに変換し、Updateを実行
|
// 画面用の型からビジネスロジック用のモデルに変換し、Updateを実行
|
||||||
|
|
||||||
updateEmployee.updateEmployee(beforeEmployee, UpdateEmployeeInfoForm.convertTo(updateEmployeeInfoForm));
|
updateEmployee.updateEmployee(beforeEmployee, UpdateEmployeeInfoForm.convertTo(updateEmployeeInfoForm));
|
||||||
|
|
||||||
// Update後の情報を再取得
|
// Update後の情報を再取得
|
||||||
|
|||||||
@@ -1,20 +1,6 @@
|
|||||||
package com.example.rhizome.app.presentation.controller;
|
package com.example.rhizome.app.presentation.controller;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
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.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
@@ -26,6 +12,18 @@ import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTa
|
|||||||
import com.example.rhizome.app.presentation.form.LoginUserForm;
|
import com.example.rhizome.app.presentation.form.LoginUserForm;
|
||||||
import com.example.rhizome.app.presentation.form.MessageForm;
|
import com.example.rhizome.app.presentation.form.MessageForm;
|
||||||
import com.example.rhizome.app.presentation.form.UpdatePersonalUserForm;
|
import com.example.rhizome.app.presentation.form.UpdatePersonalUserForm;
|
||||||
|
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.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 個人情報更新用コントローラ
|
* 個人情報更新用コントローラ
|
||||||
@@ -136,15 +134,11 @@ public class UpdatePersonalEmployeeResultController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//更新前のEmployeeの情報を取得
|
//更新前のEmployeeの情報を取得
|
||||||
Employee beforeEmployee =searchEmployee.searchEmployeeByIdEmployee(updatePersonalUserForm.getIdEmployee());
|
|
||||||
|
|
||||||
updatePersonalUserForm.setHireDate(beforeEmployee.getHireDate());
|
|
||||||
|
|
||||||
// 画面用のインスタンスから更新用のインスタンスに変換し、Update実施
|
// 画面用のインスタンスから更新用のインスタンスに変換し、Update実施
|
||||||
updateEmployee.updateEmployee(
|
updateEmployee.updateEmployee(
|
||||||
beforeEmployee,
|
searchEmployee.searchEmployeeByIdEmployee(updatePersonalUserForm.getIdEmployee()),
|
||||||
UpdatePersonalUserForm.convertTo(updatePersonalUserForm))
|
UpdatePersonalUserForm.convertTo(updatePersonalUserForm)
|
||||||
;
|
);
|
||||||
|
|
||||||
// ログイン者の情報をセッション情報に格納
|
// ログイン者の情報をセッション情報に格納
|
||||||
httpSession.setAttribute(
|
httpSession.setAttribute(
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
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 java.util.List;
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
import com.example.rhizome.app.domain.model.EmployeeInfo;
|
||||||
@@ -38,15 +40,7 @@ public class EmployeeInfoForm {
|
|||||||
*/
|
*/
|
||||||
private String password;
|
private String password;
|
||||||
/**
|
/**
|
||||||
* 入社年月日
|
* パスワード
|
||||||
*/
|
|
||||||
private String hireDate;
|
|
||||||
/**
|
|
||||||
* 勤続年数
|
|
||||||
*/
|
|
||||||
private String tenure;
|
|
||||||
/**
|
|
||||||
* 管理者権限
|
|
||||||
*/
|
*/
|
||||||
private Integer adminAuth;
|
private Integer adminAuth;
|
||||||
/**
|
/**
|
||||||
@@ -58,6 +52,16 @@ public class EmployeeInfoForm {
|
|||||||
*/
|
*/
|
||||||
private String nmDepartment;
|
private String nmDepartment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入社年月日
|
||||||
|
*/
|
||||||
|
private LocalDate dateHired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勤続年数
|
||||||
|
*/
|
||||||
|
private String lengthOfService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* business 層の EmployeeInfo クラスから画面用(presentation 層)の EmployeeInfoForm に
|
* business 層の EmployeeInfo クラスから画面用(presentation 層)の EmployeeInfoForm に
|
||||||
* 変換します。
|
* 変換します。
|
||||||
@@ -66,17 +70,22 @@ 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(),
|
||||||
employeeInfo.getEmployee().getKnEmployee(),
|
employeeInfo.getEmployee().getKnEmployee(),
|
||||||
employeeInfo.getEmployee().getMailAddress(),
|
employeeInfo.getEmployee().getMailAddress(),
|
||||||
employeeInfo.getEmployee().getPassword(),
|
employeeInfo.getEmployee().getPassword(),
|
||||||
employeeInfo.getEmployee().getHireDate(),
|
|
||||||
null,
|
|
||||||
employeeInfo.getEmployee().getAdminAuth(),
|
employeeInfo.getEmployee().getAdminAuth(),
|
||||||
employeeInfo.getDepartment().getIdDepartment(),
|
employeeInfo.getDepartment().getIdDepartment(),
|
||||||
employeeInfo.getDepartment().getNmDepartment()
|
employeeInfo.getDepartment().getNmDepartment(),
|
||||||
|
employeeInfo.getEmployee().getDateHired(),
|
||||||
|
lengthOfService
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
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.ArrayList;
|
||||||
import java.util.List;
|
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;
|
||||||
@@ -41,10 +44,6 @@ public class InsertEmployeeForm {
|
|||||||
* 確認用パスワード
|
* 確認用パスワード
|
||||||
*/
|
*/
|
||||||
private String passwordConfirm;
|
private String passwordConfirm;
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private String hireDate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理者権限
|
* 管理者権限
|
||||||
@@ -56,6 +55,12 @@ public class InsertEmployeeForm {
|
|||||||
*/
|
*/
|
||||||
private Integer idDepartment;
|
private Integer idDepartment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入社年月日
|
||||||
|
*/
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate dateHired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* パスワードのValidation
|
* パスワードのValidation
|
||||||
@@ -111,9 +116,9 @@ public class InsertEmployeeForm {
|
|||||||
insertEmployeeForm.getKnEmployee(),
|
insertEmployeeForm.getKnEmployee(),
|
||||||
insertEmployeeForm.getMailAddress(),
|
insertEmployeeForm.getMailAddress(),
|
||||||
insertEmployeeForm.getPassword(),
|
insertEmployeeForm.getPassword(),
|
||||||
insertEmployeeForm.getHireDate(),
|
|
||||||
insertEmployeeForm.getAdminAuth(),
|
insertEmployeeForm.getAdminAuth(),
|
||||||
insertEmployeeForm.getIdDepartment()
|
insertEmployeeForm.getIdDepartment(),
|
||||||
|
insertEmployeeForm.getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +133,7 @@ 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 HIREDATE_NULL_BLANK ="入社年月日";
|
final String HIRE_DATE_NULL = "入社年月日";
|
||||||
|
|
||||||
List<String> error = new ArrayList<>();
|
List<String> error = new ArrayList<>();
|
||||||
|
|
||||||
@@ -141,6 +146,9 @@ 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);
|
||||||
@@ -152,9 +160,6 @@ public class InsertEmployeeForm {
|
|||||||
if (idDepartment == null) {
|
if (idDepartment == null) {
|
||||||
error.add(DEPARTMENT_ID_NULL_BLANK);
|
error.add(DEPARTMENT_ID_NULL_BLANK);
|
||||||
}
|
}
|
||||||
if(isNullOrBlank(hireDate)) {
|
|
||||||
error.add(HIREDATE_NULL_BLANK);
|
|
||||||
}
|
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
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;
|
||||||
@@ -41,6 +44,11 @@ public class LoginUserForm {
|
|||||||
*/
|
*/
|
||||||
private Integer idDepartment;
|
private Integer idDepartment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入社年月日
|
||||||
|
*/
|
||||||
|
private LocalDate dateHired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* business 層の LoginUser クラスから画面用(presentation 層)の LoginUserForm に
|
* business 層の LoginUser クラスから画面用(presentation 層)の LoginUserForm に
|
||||||
* 変換します。
|
* 変換します。
|
||||||
@@ -56,7 +64,8 @@ public class LoginUserForm {
|
|||||||
loginUser.getMailAddress(),
|
loginUser.getMailAddress(),
|
||||||
loginUser.getPassword(),
|
loginUser.getPassword(),
|
||||||
loginUser.getAdminAuth(),
|
loginUser.getAdminAuth(),
|
||||||
loginUser.getIdDepartment()
|
loginUser.getIdDepartment(),
|
||||||
|
loginUser.getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +84,8 @@ public class LoginUserForm {
|
|||||||
loginUserForm.getMailAddress(),
|
loginUserForm.getMailAddress(),
|
||||||
loginUserForm.getPassword(),
|
loginUserForm.getPassword(),
|
||||||
loginUserForm.getAdminAuth(),
|
loginUserForm.getAdminAuth(),
|
||||||
loginUserForm.getIdDepartment()
|
loginUserForm.getIdDepartment(),
|
||||||
|
loginUserForm.getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.rhizome.app.presentation.form;
|
package com.example.rhizome.app.presentation.form;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.example.rhizome.app.domain.model.Employee;
|
import com.example.rhizome.app.domain.model.Employee;
|
||||||
@@ -41,10 +42,6 @@ public class UpdateEmployeeInfoForm {
|
|||||||
* パスワード確認用
|
* パスワード確認用
|
||||||
*/
|
*/
|
||||||
private String passwordConfirm;
|
private String passwordConfirm;
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private String hireDate;
|
|
||||||
/**
|
/**
|
||||||
* 管理者権限
|
* 管理者権限
|
||||||
*/
|
*/
|
||||||
@@ -53,6 +50,10 @@ public class UpdateEmployeeInfoForm {
|
|||||||
* 部署ID
|
* 部署ID
|
||||||
*/
|
*/
|
||||||
private Integer idDepartment;
|
private Integer idDepartment;
|
||||||
|
/**
|
||||||
|
* 入社年月日
|
||||||
|
*/
|
||||||
|
private LocalDate dateHired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* business 層の EmployeeInfo クラスから画面用(presentation 層)の UpdateEmployeeInfoForm に
|
* business 層の EmployeeInfo クラスから画面用(presentation 層)の UpdateEmployeeInfoForm に
|
||||||
@@ -69,9 +70,9 @@ public class UpdateEmployeeInfoForm {
|
|||||||
employeeInfo.getEmployee().getMailAddress(),
|
employeeInfo.getEmployee().getMailAddress(),
|
||||||
employeeInfo.getEmployee().getPassword(),
|
employeeInfo.getEmployee().getPassword(),
|
||||||
null,
|
null,
|
||||||
employeeInfo.getEmployee().getHireDate(),
|
|
||||||
employeeInfo.getEmployee().getAdminAuth(),
|
employeeInfo.getEmployee().getAdminAuth(),
|
||||||
employeeInfo.getDepartment().getIdDepartment()
|
employeeInfo.getDepartment().getIdDepartment(),
|
||||||
|
employeeInfo.getEmployee().getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,9 +101,9 @@ public class UpdateEmployeeInfoForm {
|
|||||||
updateEmployeeInfoForm.getKnEmployee(),
|
updateEmployeeInfoForm.getKnEmployee(),
|
||||||
updateEmployeeInfoForm.getMailAddress(),
|
updateEmployeeInfoForm.getMailAddress(),
|
||||||
updateEmployeeInfoForm.getPassword(),
|
updateEmployeeInfoForm.getPassword(),
|
||||||
updateEmployeeInfoForm.getHireDate(),
|
|
||||||
updateEmployeeInfoForm.getAdminAuth(),
|
updateEmployeeInfoForm.getAdminAuth(),
|
||||||
updateEmployeeInfoForm.getIdDepartment()
|
updateEmployeeInfoForm.getIdDepartment(),
|
||||||
|
updateEmployeeInfoForm.getDateHired()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,7 @@ public class UpdatePersonalUserForm {
|
|||||||
* パスワード確認用
|
* パスワード確認用
|
||||||
*/
|
*/
|
||||||
private String passwordConfirm;
|
private String passwordConfirm;
|
||||||
/**
|
|
||||||
* 入社年月日
|
|
||||||
*/
|
|
||||||
private String hireDate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 画面用(presentation 層)の UpdatePersonalUserForm クラスから business 層の Employee クラスに
|
* 画面用(presentation 層)の UpdatePersonalUserForm クラスから business 層の Employee クラスに
|
||||||
@@ -57,7 +54,7 @@ public class UpdatePersonalUserForm {
|
|||||||
updatePersonalUserForm.getKnEmployee(),
|
updatePersonalUserForm.getKnEmployee(),
|
||||||
updatePersonalUserForm.getMailAddress(),
|
updatePersonalUserForm.getMailAddress(),
|
||||||
updatePersonalUserForm.getPassword(),
|
updatePersonalUserForm.getPassword(),
|
||||||
updatePersonalUserForm.getHireDate(),
|
null,
|
||||||
null,
|
null,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
@@ -77,9 +74,7 @@ public class UpdatePersonalUserForm {
|
|||||||
employee.getKnEmployee(),
|
employee.getKnEmployee(),
|
||||||
employee.getMailAddress(),
|
employee.getMailAddress(),
|
||||||
employee.getPassword(),
|
employee.getPassword(),
|
||||||
null,
|
null
|
||||||
employee.getHireDate()
|
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +92,6 @@ public class UpdatePersonalUserForm {
|
|||||||
loginUser.getKnEmployee(),
|
loginUser.getKnEmployee(),
|
||||||
loginUser.getMailAddress(),
|
loginUser.getMailAddress(),
|
||||||
loginUser.getPassword(),
|
loginUser.getPassword(),
|
||||||
null,
|
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<form action="insertEmployee"
|
<form action="insertEmployee" id="insertForm" method="post" th:object="${insertEmployeeForm}">
|
||||||
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>
|
||||||
@@ -33,11 +30,7 @@
|
|||||||
<th class="header">社員ID</th>
|
<th class="header">社員ID</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly" name="empId" readonly="readonly" type="text" value="自動で設定されます" />
|
||||||
name="empId"
|
|
||||||
readonly="readonly"
|
|
||||||
type="text"
|
|
||||||
value="自動で設定されます"/>
|
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -45,10 +38,7 @@
|
|||||||
<th class="header">社員名</th>
|
<th class="header">社員名</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly" name="nmEmployee" readonly="readonly" th:value="*{nmEmployee}"
|
||||||
name="nmEmployee"
|
|
||||||
readonly="readonly"
|
|
||||||
th:value="*{nmEmployee}"
|
|
||||||
type="text" />
|
type="text" />
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -57,10 +47,7 @@
|
|||||||
<th class="header">社員名フリガナ</th>
|
<th class="header">社員名フリガナ</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly" name="knEmployee" readonly="readonly" th:value="*{knEmployee}"
|
||||||
name="knEmployee"
|
|
||||||
readonly="readonly"
|
|
||||||
th:value="*{knEmployee}"
|
|
||||||
type="text" />
|
type="text" />
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -69,10 +56,7 @@
|
|||||||
<th class="header">メールアドレス</th>
|
<th class="header">メールアドレス</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly" name="mailAddress" readonly="readonly" th:value="*{mailAddress}"
|
||||||
name="mailAddress"
|
|
||||||
readonly="readonly"
|
|
||||||
th:value="*{mailAddress}"
|
|
||||||
type="text" />
|
type="text" />
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -81,39 +65,22 @@
|
|||||||
<th class="header">パスワード</th>
|
<th class="header">パスワード</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly" name="password" readonly="readonly" th:value="*{password}"
|
||||||
name="password"
|
|
||||||
readonly="readonly"
|
|
||||||
th:value="*{password}"
|
|
||||||
type="password" />
|
type="password" />
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th class="header">入社年月日</th>
|
|
||||||
<td>
|
|
||||||
<label>
|
|
||||||
<input class="readOnly"
|
|
||||||
name="hireDate"
|
|
||||||
readonly="readonly"
|
|
||||||
th:value="*{hireDate}"
|
|
||||||
type="date"/>
|
|
||||||
</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th class="header">管理者権限</th>
|
<th class="header">管理者権限</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input id="adminAuth1" name="adminAuth" onclick="return false;"
|
<input id="adminAuth1" name="adminAuth" onclick="return false;"
|
||||||
th:checked="${insertEmployeeForm .adminAuth == 1}" type="radio"
|
th:checked="${insertEmployeeForm .adminAuth == 1}" type="radio" value="1"> 管理者権限
|
||||||
value="1"> 管理者権限
|
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input id="adminAuth0" name="adminAuth" onclick="return false;"
|
<input id="adminAuth0" name="adminAuth" onclick="return false;"
|
||||||
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
||||||
type="radio"
|
type="radio" value="0">
|
||||||
value="0">
|
|
||||||
一般権限
|
一般権限
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -126,8 +93,7 @@
|
|||||||
<th:block th:each="department : ${departmentFormList}">
|
<th:block th:each="department : ${departmentFormList}">
|
||||||
<th:block
|
<th:block
|
||||||
th:if="${insertEmployeeForm.idDepartment != null && department.idDepartment == insertEmployeeForm.idDepartment}">
|
th:if="${insertEmployeeForm.idDepartment != null && department.idDepartment == insertEmployeeForm.idDepartment}">
|
||||||
<option th:text="${department.nmDepartment}"
|
<option th:text="${department.nmDepartment}" th:value="${department.idDepartment}">
|
||||||
th:value="${department.idDepartment}">
|
|
||||||
</option>
|
</option>
|
||||||
</th:block>
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
@@ -135,6 +101,15 @@
|
|||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="header">入社年月日</th>
|
||||||
|
<td>
|
||||||
|
<label>
|
||||||
|
<input class="readOnly" name="dateHired" readonly="readonly" th:value="*{dateHired}"
|
||||||
|
type="text" />
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="btnArea" colspan="2">
|
<td class="btnArea" colspan="2">
|
||||||
<input type="submit" value="登録" />
|
<input type="submit" value="登録" />
|
||||||
@@ -166,4 +141,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -20,9 +20,7 @@
|
|||||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
<form action="insertEmployeeConfirm"
|
<form action="insertEmployeeConfirm" method="post" th:object="${insertEmployeeForm}">
|
||||||
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>
|
||||||
@@ -33,11 +31,7 @@
|
|||||||
<th class="header">社員ID</th>
|
<th class="header">社員ID</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly" readonly="readonly" type="text" value="自動で設定されます" />
|
||||||
readonly="readonly"
|
|
||||||
type="text"
|
|
||||||
value="自動で設定されます"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -45,12 +39,8 @@
|
|||||||
<th class="header">社員名</th>
|
<th class="header">社員名</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input maxlength="50"
|
<input maxlength="50" placeholder="社員名" required="required" th:field="*{nmEmployee}"
|
||||||
placeholder="社員名"
|
type="text" />
|
||||||
required="required"
|
|
||||||
th:field="*{nmEmployee}"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -58,13 +48,8 @@
|
|||||||
<th class="header">社員名フリガナ</th>
|
<th class="header">社員名フリガナ</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input maxlength="50"
|
<input maxlength="50" oninput="convertToKatakana(this)" placeholder="フリガナ" required="required"
|
||||||
oninput="convertToKatakana(this)"
|
th:field="*{knEmployee}" type="text" />
|
||||||
placeholder="フリガナ"
|
|
||||||
required="required"
|
|
||||||
th:field="*{knEmployee}"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -72,12 +57,8 @@
|
|||||||
<th class="header">メールアドレス</th>
|
<th class="header">メールアドレス</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input maxlength="100"
|
<input maxlength="100" placeholder="メールアドレス" required="required" th:field="*{mailAddress}"
|
||||||
placeholder="メールアドレス"
|
type="email" />
|
||||||
required="required"
|
|
||||||
th:field="*{mailAddress}"
|
|
||||||
type="email"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -85,45 +66,23 @@
|
|||||||
<th class="header">パスワード</th>
|
<th class="header">パスワード</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$"
|
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$" placeholder="パスワード"
|
||||||
placeholder="パスワード"
|
required="required" th:field="*{password}" type="password" />
|
||||||
required="required"
|
|
||||||
th:field="*{password}"
|
|
||||||
type="password"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- *** Chrome等のブラウザの場合自動でセットされる可能性があるので注意書きを外にも *** -->
|
<!-- *** Chrome等のブラウザの場合自動でセットされる可能性があるので注意書きを外にも *** -->
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<td><span
|
<td><span style="font-size:8pt; font-weight:bold; color:red;">※半角英数字をそれぞれ1種類以上含む3-10文字</span>
|
||||||
style="font-size:8pt; font-weight:bold; color:red;">※半角英数字をそれぞれ1種類以上含む3-10文字</span>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="header">パスワード確認用</th>
|
<th class="header">パスワード確認用</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$"
|
<input pattern="^(?=.*?[a-zA-Z])(?=.*?\d)[a-zA-Z\d]{3,10}$" placeholder="パスワード確認用"
|
||||||
placeholder="パスワード確認用"
|
required="required" th:field="*{passwordConfirm}" type="password" />
|
||||||
required="required"
|
|
||||||
th:field="*{passwordConfirm}"
|
|
||||||
type="password"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th class="header">入社年月日</th>
|
|
||||||
<td>
|
|
||||||
<label>
|
|
||||||
<input
|
|
||||||
placeholder="入社年月日"
|
|
||||||
required="required"
|
|
||||||
th:field="*{hireDate}"
|
|
||||||
type="date"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -132,14 +91,12 @@
|
|||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input id="adminAuth1" name="adminAuth" th:checked="${insertEmployeeForm .adminAuth == 1}"
|
<input id="adminAuth1" name="adminAuth" th:checked="${insertEmployeeForm .adminAuth == 1}"
|
||||||
type="radio"
|
type="radio" value="1"> 管理者権限
|
||||||
value="1"> 管理者権限
|
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input id="adminAuth0" name="adminAuth"
|
<input id="adminAuth0" name="adminAuth"
|
||||||
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
th:checked="${insertEmployeeForm.adminAuth == null or insertEmployeeForm.adminAuth == 0}"
|
||||||
type="radio"
|
type="radio" value="0">
|
||||||
value="0">
|
|
||||||
一般権限
|
一般権限
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -152,13 +109,21 @@
|
|||||||
<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:text="${department.nmDepartment}" th:value="${department.idDepartment}">
|
||||||
th:value="${department.idDepartment}">
|
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="header">入社年月日</th>
|
||||||
|
<td>
|
||||||
|
<label>
|
||||||
|
<input required="required" th:field="*{dateHired}"
|
||||||
|
type="date" />
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="btnArea" colspan="2">
|
<td class="btnArea" colspan="2">
|
||||||
<input type="submit" value="登録確認" />
|
<input type="submit" value="登録確認" />
|
||||||
@@ -168,4 +133,5 @@
|
|||||||
</form>
|
</form>
|
||||||
<a href="showMenu">メニューに戻る</a>
|
<a href="showMenu">メニューに戻る</a>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -105,11 +105,11 @@
|
|||||||
<th style="width: 150px;">フリガナ</th>
|
<th style="width: 150px;">フリガナ</th>
|
||||||
<th style="width: 150px;">メールアドレス</th>
|
<th style="width: 150px;">メールアドレス</th>
|
||||||
<th style="width: 100px;">パスワード</th>
|
<th style="width: 100px;">パスワード</th>
|
||||||
<th style="width: 60px;">入社年月日</th>
|
|
||||||
<th style="width: 60px;">勤続年数</th>
|
|
||||||
<th style="width: 70px;">管理者フラグ</th>
|
<th style="width: 70px;">管理者フラグ</th>
|
||||||
<th style="width: 150px;">所属部署</th>
|
<th style="width: 150px;">所属部署</th>
|
||||||
<th style="width: 150px;">操作</th>
|
<th style="width: 80px;">入社年月日</th>
|
||||||
|
<th style="width: 80px;">勤続年数</th>
|
||||||
|
<th style="width: 100px;">操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -119,10 +119,10 @@
|
|||||||
<td th:text="${employeeInfoForm.knEmployee}"></td>
|
<td th:text="${employeeInfoForm.knEmployee}"></td>
|
||||||
<td th:text="${employeeInfoForm.mailAddress}"></td>
|
<td th:text="${employeeInfoForm.mailAddress}"></td>
|
||||||
<td th:text="${employeeInfoForm.password}"></td>
|
<td th:text="${employeeInfoForm.password}"></td>
|
||||||
<td th:text="${employeeInfoForm.hireDate}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.tenure}"></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;">
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
-- CREATE USER 'rezouser'@'localhost' IDENTIFIED BY 'Rezo_0000';
|
-- CREATE USER 'rezouser'@'localhost' IDENTIFIED BY 'Rezo_0000';
|
||||||
-- GRANT ALL ON rezodb.* TO 'rezouser'@'localhost';
|
-- GRANT ALL ON rezodb.* TO 'rezouser'@'localhost';
|
||||||
|
|
||||||
|
|
||||||
-- employee<65>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD>̍쐬
|
-- employee<65>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD>̍쐬
|
||||||
DROP TABLE IF EXISTS employee;
|
DROP TABLE IF EXISTS employee;
|
||||||
CREATE TABLE employee (
|
CREATE TABLE employee (
|
||||||
@@ -15,7 +14,6 @@ CREATE TABLE employee (
|
|||||||
, password VARCHAR(10) NOT NULL
|
, password VARCHAR(10) NOT NULL
|
||||||
, admin_auth INT NOT NULL
|
, admin_auth INT NOT NULL
|
||||||
, id_department INT NOT NULL
|
, id_department INT NOT NULL
|
||||||
, hire_date DATE NOT NULL
|
|
||||||
)
|
)
|
||||||
AUTO_INCREMENT = 10000;
|
AUTO_INCREMENT = 10000;
|
||||||
|
|
||||||
@@ -28,16 +26,16 @@ CREATE TABLE department (
|
|||||||
AUTO_INCREMENT = 10;
|
AUTO_INCREMENT = 10;
|
||||||
|
|
||||||
-- <20>Ј<EFBFBD><D088>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD>̃f<CC83>[<5B>^
|
-- <20>Ј<EFBFBD><D088>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD>̃f<CC83>[<5B>^
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD>R<EFBFBD>c<EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<EFBFBD><EFBFBD><EFBFBD>}<7D>_<EFBFBD>^<5E>c<EFBFBD><63>','yamada@hoge.jp','aaa',1,10,'1990-01-01');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD>R<EFBFBD>c<EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<EFBFBD><EFBFBD><EFBFBD>}<7D>_<EFBFBD>^<5E>c<EFBFBD><63>','yamada@hoge.jp','aaa',1,10);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<EFBFBD>^<5E>J<EFBFBD>n<EFBFBD>V<EFBFBD>W<EFBFBD><57><EFBFBD><EFBFBD>','jtaka@hoge.jp','bbb',0,10,'2000-02-02');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<EFBFBD>^<5E>J<EFBFBD>n<EFBFBD>V<EFBFBD>W<EFBFBD><57><EFBFBD><EFBFBD>','jtaka@hoge.jp','bbb',0,10);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD><EFBFBD><EFBFBD>}<7D>j<EFBFBD><6A>','<EFBFBD>}<7D>G<EFBFBD>_<EFBFBD>t<EFBFBD>~<7E>A<EFBFBD>L','fmak@hoge.jp','ccc',0,11,'1990-02-02');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD><EFBFBD><EFBFBD>}<7D>j<EFBFBD><6A>','<EFBFBD>}<7D>G<EFBFBD>_<EFBFBD>t<EFBFBD>~<7E>A<EFBFBD>L','fmak@hoge.jp','ccc',0,11);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD>یˏ͉<EFBFBD>','<EFBFBD>}<7D><><EFBFBD>g<EFBFBD>V<EFBFBD><56><EFBFBD>E<EFBFBD>X<EFBFBD>P','marusyo@hoge.jp','ddd',0,12,'1990-03-03');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD>یˏ͉<EFBFBD>','<EFBFBD>}<7D><><EFBFBD>g<EFBFBD>V<EFBFBD><56><EFBFBD>E<EFBFBD>X<EFBFBD>P','marusyo@hoge.jp','ddd',0,12);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD>O<EFBFBD>','<EFBFBD>~<7E><><EFBFBD>P<EFBFBD>^<5E>P<EFBFBD>V','miya@hoge.jp','eee',0,13,'1999-04-04');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD>O<EFBFBD>','<EFBFBD>~<7E><><EFBFBD>P<EFBFBD>^<5E>P<EFBFBD>V','miya@hoge.jp','eee',0,13);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD>ۈ<EFBFBD><EFBFBD>I','<EFBFBD>}<7D><><EFBFBD>C<EFBFBD>n<EFBFBD><6E><EFBFBD>J','haru@hoge.jp','fff',0,13,'2000-03-03');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD>ۈ<EFBFBD><EFBFBD>I','<EFBFBD>}<7D><><EFBFBD>C<EFBFBD>n<EFBFBD><6E><EFBFBD>J','haru@hoge.jp','fff',0,13);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>D','<EFBFBD>X<EFBFBD>Y<EFBFBD><EFBFBD><EFBFBD>g<EFBFBD>J<EFBFBD>I<EFBFBD><EFBFBD>','suzumoto@hoge.jp','ggg',0,13,'2001-05-05');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>D','<EFBFBD>X<EFBFBD>Y<EFBFBD><EFBFBD><EFBFBD>g<EFBFBD>J<EFBFBD>I<EFBFBD><EFBFBD>','suzumoto@hoge.jp','ggg',0,13);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD>t<EFBFBD>R<EFBFBD><EFBFBD>','<EFBFBD>n<EFBFBD><EFBFBD><EFBFBD>}<7D>~<7E>m<EFBFBD><6D>','mhayama@hoge.jp','hhh',0,14,'2016-08-08');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD>t<EFBFBD>R<EFBFBD><EFBFBD>','<EFBFBD>n<EFBFBD><EFBFBD><EFBFBD>}<7D>~<7E>m<EFBFBD><6D>','mhayama@hoge.jp','hhh',0,14);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>闢','<EFBFBD>J<EFBFBD><EFBFBD><EFBFBD>J<EFBFBD>~<7E>A<EFBFBD>J<EFBFBD><4A>','kawakami@hoge.jp','iii',0,14,'2025-10-10');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>闢','<EFBFBD>J<EFBFBD><EFBFBD><EFBFBD>J<EFBFBD>~<7E>A<EFBFBD>J<EFBFBD><4A>','kawakami@hoge.jp','iii',0,14);
|
||||||
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department, hire_date) VALUES ('<EFBFBD><EFBFBD><EFBFBD>䔣','<EFBFBD>X<EFBFBD>M<EFBFBD>C<EFBFBD>n<EFBFBD>W<EFBFBD><EFBFBD>','sugi@hoge.jp','jjj',0,15,'2026-04-04');
|
INSERT INTO employee (nm_employee, kn_employee, mail_address, password, admin_auth, id_department) VALUES ('<EFBFBD><EFBFBD><EFBFBD>䔣','<EFBFBD>X<EFBFBD>M<EFBFBD>C<EFBFBD>n<EFBFBD>W<EFBFBD><EFBFBD>','sugi@hoge.jp','jjj',0,15);
|
||||||
|
|
||||||
-- <20><><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD>̃f<CC83>[<5B>^
|
-- <20><><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD>̃f<CC83>[<5B>^
|
||||||
INSERT INTO department (nm_department) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
INSERT INTO department (nm_department) VALUES ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||||
|
|||||||
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.
Binary file not shown.
BIN
設計書/テーブル定義書.xlsm
BIN
設計書/テーブル定義書.xlsm
Binary file not shown.
Reference in New Issue
Block a user