Compare commits
1 Commits
14c1f9521c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4ae39c587 |
@@ -29,10 +29,6 @@ public class Employee {
|
||||
* パスワード
|
||||
*/
|
||||
private final String password;
|
||||
/**
|
||||
* 入社年月日
|
||||
*/
|
||||
private final String hireDate;
|
||||
/**
|
||||
* 管理者権限
|
||||
*/
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
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 +51,6 @@ public class UpdateEmployeeImpl implements UpdateEmployee {
|
||||
updateEmployee.getKnEmployee(),
|
||||
updateEmployee.getMailAddress(),
|
||||
updateEmployee.getPassword().isBlank() ? beforeEmployee.getPassword() : updateEmployee.getPassword(),
|
||||
updateEmployee.getHireDate(),
|
||||
updateEmployee.getAdminAuth() == null ? beforeEmployee.getAdminAuth() : updateEmployee.getAdminAuth(),
|
||||
updateEmployee.getIdDepartment() == null ? beforeEmployee.getIdDepartment() : updateEmployee.getIdDepartment()
|
||||
);
|
||||
|
||||
@@ -1,27 +1,16 @@
|
||||
package com.example.rhizome.app.infra.entity;
|
||||
|
||||
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.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
|
||||
@@ -71,12 +60,6 @@ public class EmployeeDepartmentEntity {
|
||||
@Column(name = "password", nullable = false)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 入社年月日
|
||||
*/
|
||||
@Column(name = "hire_date", nullable = false)
|
||||
private String hireDate;
|
||||
|
||||
/**
|
||||
* 管理者権限
|
||||
*/
|
||||
@@ -87,7 +70,6 @@ public class EmployeeDepartmentEntity {
|
||||
@JoinColumn(name = "id_department", referencedColumnName = "id_department", insertable = false, updatable = false)
|
||||
@Fetch(FetchMode.JOIN)
|
||||
private DepartmentEntity department;
|
||||
|
||||
|
||||
/**
|
||||
* EmployeeDepartmentEntity(DataAccess層依存) を EmployeeInfo(BusinessLogic層依存) に変換します。
|
||||
@@ -107,9 +89,9 @@ public class EmployeeDepartmentEntity {
|
||||
employeeDepartmentEntity.getKnEmployee(),
|
||||
employeeDepartmentEntity.getMailAddress(),
|
||||
employeeDepartmentEntity.getPassword(),
|
||||
employeeDepartmentEntity.getHireDate(),
|
||||
employeeDepartmentEntity.getAdminAuth(),
|
||||
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getIdDepartment() ),
|
||||
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getIdDepartment()
|
||||
),
|
||||
new Department(
|
||||
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getIdDepartment(),
|
||||
employeeDepartmentEntity.getDepartment() == null ? null : employeeDepartmentEntity.getDepartment().getNmDepartment()
|
||||
|
||||
@@ -7,23 +7,16 @@
|
||||
package com.example.rhizome.app.infra.entity;
|
||||
|
||||
|
||||
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
|
||||
*
|
||||
@@ -68,11 +61,6 @@ public class EmployeeEntity {
|
||||
@Column(name = "password", nullable = false)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 入社年月日
|
||||
*/
|
||||
@Column(name = "hire_Date", nullable = false)
|
||||
private String hireDate;
|
||||
/**
|
||||
* 管理者権限
|
||||
*/
|
||||
@@ -84,7 +72,6 @@ public class EmployeeEntity {
|
||||
*/
|
||||
@Column(name = "id_department", nullable = false)
|
||||
private Integer idDepartment;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -101,7 +88,6 @@ public class EmployeeEntity {
|
||||
employee.getKnEmployee(),
|
||||
employee.getMailAddress(),
|
||||
employee.getPassword(),
|
||||
employee.getHireDate(),
|
||||
employee.getAdminAuth(),
|
||||
employee.getIdDepartment()
|
||||
);
|
||||
@@ -142,7 +128,6 @@ public class EmployeeEntity {
|
||||
employeeEntity.getKnEmployee(),
|
||||
employeeEntity.getMailAddress(),
|
||||
employeeEntity.getPassword(),
|
||||
employeeEntity.getHireDate(),
|
||||
employeeEntity.getAdminAuth(),
|
||||
employeeEntity.getIdDepartment()
|
||||
);
|
||||
|
||||
@@ -1,21 +1,5 @@
|
||||
package com.example.rhizome.app.presentation.controller;
|
||||
|
||||
import static com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword.*;
|
||||
|
||||
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;
|
||||
@@ -27,6 +11,20 @@ import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTa
|
||||
import com.example.rhizome.app.presentation.form.DepartmentForm;
|
||||
import com.example.rhizome.app.presentation.form.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;
|
||||
|
||||
/**
|
||||
* 新規登録用のコントローラ
|
||||
@@ -83,7 +81,6 @@ public class InsertEmployeeController {
|
||||
insertEmployeeForm.getKnEmployee(),
|
||||
insertEmployeeForm.getMailAddress(),
|
||||
insertEmployeeForm.getPassword(),
|
||||
insertEmployeeForm.getHireDate(),
|
||||
insertEmployeeForm.getAdminAuth(),
|
||||
insertEmployeeForm.getIdDepartment()
|
||||
);
|
||||
@@ -128,7 +125,6 @@ public class InsertEmployeeController {
|
||||
String employeeKana,
|
||||
String mailAddress,
|
||||
String password,
|
||||
String hireDate,
|
||||
Integer management,
|
||||
Integer departmentId
|
||||
) {
|
||||
@@ -137,7 +133,6 @@ public class InsertEmployeeController {
|
||||
final String EMPLOYEE_KANA_NULL_BLANK = "社員名フリガナ";
|
||||
final String MAIL_ADDRESS_NULL_BLANK = "メールアドレス";
|
||||
final String PASSWORD_NULL_BLANK = "パスワード";
|
||||
final String HIREDATE_NULL_BLANK = "入社年月日";
|
||||
final String MANAGEMENT_ERROR = "管理者権限指定";
|
||||
final String DEPARTMENT_ID_NULL_BLANK = "所属部署";
|
||||
|
||||
@@ -166,11 +161,6 @@ public class InsertEmployeeController {
|
||||
// エラー内容を追加
|
||||
error.add(PASSWORD_NULL_BLANK);
|
||||
}
|
||||
// null or 空文字判定
|
||||
if (isNullOrBlank(hireDate)) {
|
||||
// エラー内容を追加
|
||||
error.add(HIREDATE_NULL_BLANK);
|
||||
}
|
||||
|
||||
// 管理者権限の値が不正か
|
||||
if (management == null) {
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
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;
|
||||
@@ -19,6 +7,16 @@ import com.example.rhizome.app.presentation.controller.pageproperty.PageReturnAt
|
||||
import com.example.rhizome.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword;
|
||||
import com.example.rhizome.app.presentation.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;
|
||||
|
||||
/**
|
||||
* 部署検索画面用コントローラ リスト全件表示、検索表示、更新、削除が可能
|
||||
@@ -62,7 +60,7 @@ public class SelectDepartmentController {
|
||||
// 作成した部署一覧をセット
|
||||
model.addAttribute(
|
||||
PageReturnAttributeKeyword.DEPARTMENT_FORM_LIST,
|
||||
DepartmentForm.convertFrom(searchDepartment.searchBy(SearchConditionDepartmentForm.convertTo(searchConditionDepartmentForm)))
|
||||
DepartmentForm.convertFrom(searchDepartment.searchByWithLike(SearchConditionDepartmentForm.convertTo(searchConditionDepartmentForm)))
|
||||
);
|
||||
|
||||
// 検索ページに遷移
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.example.rhizome.app.presentation.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import com.example.rhizome.aop.aspect.PermissionCheck;
|
||||
import com.example.rhizome.aop.aspect.SessionCheck;
|
||||
import com.example.rhizome.app.domain.service.SearchDepartment;
|
||||
import com.example.rhizome.app.domain.service.SearchEmployeeInfo;
|
||||
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.stereotype.Controller;
|
||||
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.RequestMethod;
|
||||
|
||||
import com.example.rhizome.aop.aspect.PermissionCheck;
|
||||
import com.example.rhizome.aop.aspect.SessionCheck;
|
||||
import com.example.rhizome.app.domain.service.SearchDepartment;
|
||||
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;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* 社員検索画面用コントローラ リスト全件表示、検索表示、更新、削除が可能
|
||||
@@ -38,13 +34,12 @@ public class SelectEmployeeController {
|
||||
HttpSession httpSession;
|
||||
SearchDepartment searchDepartment;
|
||||
SearchEmployeeInfo searchEmployeeInfo;
|
||||
TenureCalc tenureCalc;
|
||||
|
||||
@Autowired
|
||||
public SelectEmployeeController(HttpSession httpSession, SearchDepartment searchDepartment, SearchEmployeeInfo searchEmployeeInfo ,TenureCalc tenureCalc) {
|
||||
public SelectEmployeeController(HttpSession httpSession, SearchDepartment searchDepartment, SearchEmployeeInfo searchEmployeeInfo) {
|
||||
this.httpSession = httpSession;
|
||||
this.searchDepartment = searchDepartment;
|
||||
this.searchEmployeeInfo = searchEmployeeInfo;
|
||||
this.tenureCalc = tenureCalc;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
@@ -75,14 +70,7 @@ public class SelectEmployeeController {
|
||||
|
||||
// 検索条件を元に検索を実施
|
||||
// 取得した EmployeeInfo( employee + department )の情報を画面に返す用の型に詰め替えてセット
|
||||
|
||||
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);
|
||||
model.addAttribute(PageReturnAttributeKeyword.EMPLOYEE_INFO_FORM_LIST, EmployeeInfoForm.convertFrom(searchEmployeeInfo.searchBy(SearchConditionEmployeeForm.convertTo(searchConditionEmployeeForm))));
|
||||
// 検索ページに遷移
|
||||
return TransitionTargetPageNameKeyword.SELECT_EMPLOYEE_HTML;
|
||||
|
||||
@@ -121,16 +109,11 @@ public class SelectEmployeeController {
|
||||
);
|
||||
|
||||
// 検索条件を元に検索を実施
|
||||
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);
|
||||
model.addAttribute(PageReturnAttributeKeyword.EMPLOYEE_INFO_FORM_LIST,
|
||||
EmployeeInfoForm.convertFrom(
|
||||
searchEmployeeInfo.searchBy(
|
||||
SearchConditionEmployeeForm.convertTo(searchConditionEmployeeForm())
|
||||
)));
|
||||
|
||||
// 検索ページに遷移
|
||||
return TransitionTargetPageNameKeyword.SELECT_EMPLOYEE_HTML;
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
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.SessionCheck;
|
||||
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.MessageForm;
|
||||
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 を更新して結果を返す為のコントローラ
|
||||
@@ -149,11 +147,8 @@ public class UpdateEmployeeResultController {
|
||||
|
||||
return TransitionTargetPageNameKeyword.UPDATE_EMPLOYEE_INPUT_HTML;
|
||||
}
|
||||
|
||||
updateEmployeeInfoForm.setHireDate(beforeEmployee.getHireDate());
|
||||
|
||||
// 画面用の型からビジネスロジック用のモデルに変換し、Updateを実行
|
||||
|
||||
updateEmployee.updateEmployee(beforeEmployee, UpdateEmployeeInfoForm.convertTo(updateEmployeeInfoForm));
|
||||
|
||||
// Update後の情報を再取得
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
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.SessionCheck;
|
||||
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.MessageForm;
|
||||
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 beforeEmployee =searchEmployee.searchEmployeeByIdEmployee(updatePersonalUserForm.getIdEmployee());
|
||||
|
||||
updatePersonalUserForm.setHireDate(beforeEmployee.getHireDate());
|
||||
|
||||
// 画面用のインスタンスから更新用のインスタンスに変換し、Update実施
|
||||
updateEmployee.updateEmployee(
|
||||
beforeEmployee,
|
||||
UpdatePersonalUserForm.convertTo(updatePersonalUserForm))
|
||||
;
|
||||
searchEmployee.searchEmployeeByIdEmployee(updatePersonalUserForm.getIdEmployee()),
|
||||
UpdatePersonalUserForm.convertTo(updatePersonalUserForm)
|
||||
);
|
||||
|
||||
// ログイン者の情報をセッション情報に格納
|
||||
httpSession.setAttribute(
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.example.rhizome.app.presentation.form;
|
||||
|
||||
|
||||
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 した構造を扱うクラス
|
||||
*/
|
||||
@@ -38,15 +37,7 @@ public class EmployeeInfoForm {
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 入社年月日
|
||||
*/
|
||||
private String hireDate;
|
||||
/**
|
||||
* 勤続年数
|
||||
*/
|
||||
private String tenure;
|
||||
/**
|
||||
* 管理者権限
|
||||
* パスワード
|
||||
*/
|
||||
private Integer adminAuth;
|
||||
/**
|
||||
@@ -72,8 +63,6 @@ public class EmployeeInfoForm {
|
||||
employeeInfo.getEmployee().getKnEmployee(),
|
||||
employeeInfo.getEmployee().getMailAddress(),
|
||||
employeeInfo.getEmployee().getPassword(),
|
||||
employeeInfo.getEmployee().getHireDate(),
|
||||
null,
|
||||
employeeInfo.getEmployee().getAdminAuth(),
|
||||
employeeInfo.getDepartment().getIdDepartment(),
|
||||
employeeInfo.getDepartment().getNmDepartment()
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.example.rhizome.app.presentation.form;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 画面から渡ってきた登録内容をまとめ、再度画面に表示する為のクラス
|
||||
*/
|
||||
@@ -41,10 +40,6 @@ public class InsertEmployeeForm {
|
||||
* 確認用パスワード
|
||||
*/
|
||||
private String passwordConfirm;
|
||||
/**
|
||||
* 入社年月日
|
||||
*/
|
||||
private String hireDate;
|
||||
|
||||
/**
|
||||
* 管理者権限
|
||||
@@ -55,7 +50,6 @@ public class InsertEmployeeForm {
|
||||
* 部署ID
|
||||
*/
|
||||
private Integer idDepartment;
|
||||
|
||||
|
||||
/**
|
||||
* パスワードのValidation
|
||||
@@ -111,7 +105,6 @@ public class InsertEmployeeForm {
|
||||
insertEmployeeForm.getKnEmployee(),
|
||||
insertEmployeeForm.getMailAddress(),
|
||||
insertEmployeeForm.getPassword(),
|
||||
insertEmployeeForm.getHireDate(),
|
||||
insertEmployeeForm.getAdminAuth(),
|
||||
insertEmployeeForm.getIdDepartment()
|
||||
);
|
||||
@@ -128,7 +121,6 @@ public class InsertEmployeeForm {
|
||||
final String MAIL_ADDRESS_NULL_BLANK = "メールアドレス";
|
||||
final String MANAGEMENT_ERROR = "管理者権限指定";
|
||||
final String DEPARTMENT_ID_NULL_BLANK = "所属部署";
|
||||
final String HIREDATE_NULL_BLANK ="入社年月日";
|
||||
|
||||
List<String> error = new ArrayList<>();
|
||||
|
||||
@@ -152,9 +144,6 @@ public class InsertEmployeeForm {
|
||||
if (idDepartment == null) {
|
||||
error.add(DEPARTMENT_ID_NULL_BLANK);
|
||||
}
|
||||
if(isNullOrBlank(hireDate)) {
|
||||
error.add(HIREDATE_NULL_BLANK);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.example.rhizome.app.presentation.form;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 画面から渡ってきた更新内容をまとめ、再度画面に表示する為のクラス
|
||||
*/
|
||||
@@ -41,10 +40,6 @@ public class UpdateEmployeeInfoForm {
|
||||
* パスワード確認用
|
||||
*/
|
||||
private String passwordConfirm;
|
||||
/**
|
||||
* 入社年月日
|
||||
*/
|
||||
private String hireDate;
|
||||
/**
|
||||
* 管理者権限
|
||||
*/
|
||||
@@ -69,7 +64,6 @@ public class UpdateEmployeeInfoForm {
|
||||
employeeInfo.getEmployee().getMailAddress(),
|
||||
employeeInfo.getEmployee().getPassword(),
|
||||
null,
|
||||
employeeInfo.getEmployee().getHireDate(),
|
||||
employeeInfo.getEmployee().getAdminAuth(),
|
||||
employeeInfo.getDepartment().getIdDepartment()
|
||||
);
|
||||
@@ -100,7 +94,6 @@ public class UpdateEmployeeInfoForm {
|
||||
updateEmployeeInfoForm.getKnEmployee(),
|
||||
updateEmployeeInfoForm.getMailAddress(),
|
||||
updateEmployeeInfoForm.getPassword(),
|
||||
updateEmployeeInfoForm.getHireDate(),
|
||||
updateEmployeeInfoForm.getAdminAuth(),
|
||||
updateEmployeeInfoForm.getIdDepartment()
|
||||
);
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.example.rhizome.app.presentation.form;
|
||||
|
||||
import com.example.rhizome.app.domain.model.Employee;
|
||||
import com.example.rhizome.app.domain.model.LoginUser;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -38,10 +37,7 @@ public class UpdatePersonalUserForm {
|
||||
* パスワード確認用
|
||||
*/
|
||||
private String passwordConfirm;
|
||||
/**
|
||||
* 入社年月日
|
||||
*/
|
||||
private String hireDate;
|
||||
|
||||
|
||||
/**
|
||||
* 画面用(presentation 層)の UpdatePersonalUserForm クラスから business 層の Employee クラスに
|
||||
@@ -57,7 +53,6 @@ public class UpdatePersonalUserForm {
|
||||
updatePersonalUserForm.getKnEmployee(),
|
||||
updatePersonalUserForm.getMailAddress(),
|
||||
updatePersonalUserForm.getPassword(),
|
||||
updatePersonalUserForm.getHireDate(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
@@ -77,9 +72,7 @@ public class UpdatePersonalUserForm {
|
||||
employee.getKnEmployee(),
|
||||
employee.getMailAddress(),
|
||||
employee.getPassword(),
|
||||
null,
|
||||
employee.getHireDate()
|
||||
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -97,7 +90,6 @@ public class UpdatePersonalUserForm {
|
||||
loginUser.getKnEmployee(),
|
||||
loginUser.getMailAddress(),
|
||||
loginUser.getPassword(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,18 +89,6 @@
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="header">入社年月日</th>
|
||||
<td>
|
||||
<label>
|
||||
<input class="readOnly"
|
||||
name="hireDate"
|
||||
readonly="readonly"
|
||||
th:value="*{hireDate}"
|
||||
type="date"/>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="header">管理者権限</th>
|
||||
<td>
|
||||
|
||||
@@ -114,19 +114,6 @@
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="header">入社年月日</th>
|
||||
<td>
|
||||
<label>
|
||||
<input
|
||||
placeholder="入社年月日"
|
||||
required="required"
|
||||
th:field="*{hireDate}"
|
||||
type="date"
|
||||
/>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="header">管理者権限</th>
|
||||
<td>
|
||||
|
||||
@@ -105,8 +105,6 @@
|
||||
<th style="width: 150px;">フリガナ</th>
|
||||
<th style="width: 150px;">メールアドレス</th>
|
||||
<th style="width: 100px;">パスワード</th>
|
||||
<th style="width: 60px;">入社年月日</th>
|
||||
<th style="width: 60px;">勤続年数</th>
|
||||
<th style="width: 70px;">管理者フラグ</th>
|
||||
<th style="width: 150px;">所属部署</th>
|
||||
<th style="width: 150px;">操作</th>
|
||||
@@ -119,8 +117,6 @@
|
||||
<td th:text="${employeeInfoForm.knEmployee}"></td>
|
||||
<td th:text="${employeeInfoForm.mailAddress}"></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.nmDepartment}"></td>
|
||||
<td>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
-- CREATE USER 'rezouser'@'localhost' IDENTIFIED BY 'Rezo_0000';
|
||||
-- GRANT ALL ON rezodb.* TO 'rezouser'@'localhost';
|
||||
|
||||
|
||||
-- employee<65>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD>̍쐬
|
||||
DROP TABLE IF EXISTS employee;
|
||||
CREATE TABLE employee (
|
||||
@@ -15,7 +14,6 @@ CREATE TABLE employee (
|
||||
, password VARCHAR(10) NOT NULL
|
||||
, admin_auth INT NOT NULL
|
||||
, id_department INT NOT NULL
|
||||
, hire_date DATE NOT NULL
|
||||
)
|
||||
AUTO_INCREMENT = 10000;
|
||||
|
||||
@@ -28,16 +26,16 @@ CREATE TABLE department (
|
||||
AUTO_INCREMENT = 10;
|
||||
|
||||
-- <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, 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, 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, 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, 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, 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, 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, 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, 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, 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>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) 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) 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) 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) 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) 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) 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) 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) 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) 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>^
|
||||
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.
BIN
設計書/テーブル定義書.xlsm
BIN
設計書/テーブル定義書.xlsm
Binary file not shown.
Reference in New Issue
Block a user