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