Merge pull request #377 feature-NEWDWH2021-1507-download into develop-emp-chg-inst
This commit is contained in:
commit
63c4d149d8
@ -199,7 +199,7 @@ def new_inst_result_view(
|
|||||||
return templates_response
|
return templates_response
|
||||||
|
|
||||||
|
|
||||||
@ router.get('/instEmpCsvDL', response_class=HTMLResponse)
|
@router.get('/instEmpCsvDL', response_class=HTMLResponse)
|
||||||
def inst_emp_csv_download_view(
|
def inst_emp_csv_download_view(
|
||||||
request: Request,
|
request: Request,
|
||||||
batch_status_service: BatchStatusService = Depends(get_service(BatchStatusService))
|
batch_status_service: BatchStatusService = Depends(get_service(BatchStatusService))
|
||||||
@ -270,6 +270,7 @@ def inst_emp_csv_download(
|
|||||||
ta_cd=csv_download_form.ta_cd,
|
ta_cd=csv_download_form.ta_cd,
|
||||||
inst_cd=csv_download_form.inst_cd,
|
inst_cd=csv_download_form.inst_cd,
|
||||||
emp_cd=csv_download_form.emp_cd,
|
emp_cd=csv_download_form.emp_cd,
|
||||||
|
emp_chg_type_cd=csv_download_form.emp_chg_type_cd,
|
||||||
apply_date_from=csv_download_form.apply_date_from,
|
apply_date_from=csv_download_form.apply_date_from,
|
||||||
start_date_from=csv_download_form.start_date_from,
|
start_date_from=csv_download_form.start_date_from,
|
||||||
start_date_to=csv_download_form.start_date_to,
|
start_date_to=csv_download_form.start_date_to,
|
||||||
|
|||||||
@ -2,20 +2,22 @@ from typing import Optional
|
|||||||
|
|
||||||
from fastapi import Form
|
from fastapi import Form
|
||||||
|
|
||||||
from src.util.sanitize import sanitize
|
|
||||||
|
|
||||||
from src.model.request.request_base_model import RequestBaseModel
|
from src.model.request.request_base_model import RequestBaseModel
|
||||||
|
from src.util.sanitize import sanitize
|
||||||
from src.util.string_util import is_not_empty
|
from src.util.string_util import is_not_empty
|
||||||
|
|
||||||
|
|
||||||
@sanitize
|
@sanitize
|
||||||
class MasterMainteCsvDlModel(RequestBaseModel):
|
class MasterMainteCsvDlModel(RequestBaseModel):
|
||||||
|
# adaptは検索に使用する値
|
||||||
ta_cd: Optional[str]
|
ta_cd: Optional[str]
|
||||||
adapt_ta_cd: Optional[str]
|
adapt_ta_cd: Optional[str]
|
||||||
inst_cd: Optional[str]
|
inst_cd: Optional[str]
|
||||||
adapt_inst_cd: Optional[str]
|
adapt_inst_cd: Optional[str]
|
||||||
emp_cd: Optional[str]
|
emp_cd: Optional[str]
|
||||||
adapt_emp_cd: Optional[str]
|
adapt_emp_cd: Optional[str]
|
||||||
|
emp_chg_type_cd: Optional[str]
|
||||||
|
adapt_emp_chg_type_cd: Optional[str]
|
||||||
apply_date_from: Optional[str]
|
apply_date_from: Optional[str]
|
||||||
adapt_apply_date_from: Optional[str]
|
adapt_apply_date_from: Optional[str]
|
||||||
start_date_from: Optional[str]
|
start_date_from: Optional[str]
|
||||||
@ -42,6 +44,7 @@ class MasterMainteCsvDlModel(RequestBaseModel):
|
|||||||
ctrl_ta_cd: Optional[str] = Form(None),
|
ctrl_ta_cd: Optional[str] = Form(None),
|
||||||
ctrl_inst_cd: Optional[str] = Form(None),
|
ctrl_inst_cd: Optional[str] = Form(None),
|
||||||
ctrl_emp_cd: Optional[str] = Form(None),
|
ctrl_emp_cd: Optional[str] = Form(None),
|
||||||
|
ctrl_emp_chg_type_cd: Optional[str] = Form(None),
|
||||||
ctrl_apply_date_from: Optional[str] = Form(None),
|
ctrl_apply_date_from: Optional[str] = Form(None),
|
||||||
ctrl_start_date_from: Optional[str] = Form(None),
|
ctrl_start_date_from: Optional[str] = Form(None),
|
||||||
ctrl_start_date_to: Optional[str] = Form(None),
|
ctrl_start_date_to: Optional[str] = Form(None),
|
||||||
@ -58,6 +61,7 @@ class MasterMainteCsvDlModel(RequestBaseModel):
|
|||||||
ctrl_ta_cd,
|
ctrl_ta_cd,
|
||||||
ctrl_inst_cd,
|
ctrl_inst_cd,
|
||||||
ctrl_emp_cd,
|
ctrl_emp_cd,
|
||||||
|
ctrl_emp_chg_type_cd,
|
||||||
ctrl_apply_date_from,
|
ctrl_apply_date_from,
|
||||||
ctrl_start_date_from,
|
ctrl_start_date_from,
|
||||||
ctrl_start_date_to,
|
ctrl_start_date_to,
|
||||||
@ -75,6 +79,7 @@ class MasterMainteCsvDlModel(RequestBaseModel):
|
|||||||
ctrl_ta_cd: str,
|
ctrl_ta_cd: str,
|
||||||
ctrl_inst_cd: str,
|
ctrl_inst_cd: str,
|
||||||
ctrl_emp_cd: str,
|
ctrl_emp_cd: str,
|
||||||
|
ctrl_emp_chg_type_cd,
|
||||||
ctrl_apply_date_from: str,
|
ctrl_apply_date_from: str,
|
||||||
ctrl_start_date_from: str,
|
ctrl_start_date_from: str,
|
||||||
ctrl_start_date_to: str,
|
ctrl_start_date_to: str,
|
||||||
@ -89,6 +94,7 @@ class MasterMainteCsvDlModel(RequestBaseModel):
|
|||||||
ctrl_ta_cd = ctrl_ta_cd if is_not_empty(ctrl_ta_cd) else ''
|
ctrl_ta_cd = ctrl_ta_cd if is_not_empty(ctrl_ta_cd) else ''
|
||||||
ctrl_inst_cd = ctrl_inst_cd if is_not_empty(ctrl_inst_cd) else ''
|
ctrl_inst_cd = ctrl_inst_cd if is_not_empty(ctrl_inst_cd) else ''
|
||||||
ctrl_emp_cd = ctrl_emp_cd if is_not_empty(ctrl_emp_cd) else ''
|
ctrl_emp_cd = ctrl_emp_cd if is_not_empty(ctrl_emp_cd) else ''
|
||||||
|
ctrl_emp_chg_type_cd = ctrl_emp_chg_type_cd if is_not_empty(ctrl_emp_chg_type_cd) else ''
|
||||||
|
|
||||||
adapt_apply_date_from = ''
|
adapt_apply_date_from = ''
|
||||||
if is_not_empty(ctrl_apply_date_from):
|
if is_not_empty(ctrl_apply_date_from):
|
||||||
@ -147,6 +153,8 @@ class MasterMainteCsvDlModel(RequestBaseModel):
|
|||||||
adapt_inst_cd=ctrl_inst_cd,
|
adapt_inst_cd=ctrl_inst_cd,
|
||||||
emp_cd=ctrl_emp_cd,
|
emp_cd=ctrl_emp_cd,
|
||||||
adapt_emp_cd=ctrl_emp_cd,
|
adapt_emp_cd=ctrl_emp_cd,
|
||||||
|
emp_chg_type_cd=ctrl_emp_chg_type_cd,
|
||||||
|
adapt_emp_chg_type_cd=ctrl_emp_chg_type_cd,
|
||||||
apply_date_from=ctrl_apply_date_from,
|
apply_date_from=ctrl_apply_date_from,
|
||||||
adapt_apply_date_from=adapt_apply_date_from,
|
adapt_apply_date_from=adapt_apply_date_from,
|
||||||
start_date_from=ctrl_start_date_from,
|
start_date_from=ctrl_start_date_from,
|
||||||
|
|||||||
@ -9,6 +9,7 @@ class InstEmpCsvDownloadViewModel(BaseModel):
|
|||||||
ta_cd: str = ''
|
ta_cd: str = ''
|
||||||
inst_cd: str = ''
|
inst_cd: str = ''
|
||||||
emp_cd: str = ''
|
emp_cd: str = ''
|
||||||
|
emp_chg_type_cd: str = ''
|
||||||
apply_date_from: str = ''
|
apply_date_from: str = ''
|
||||||
start_date_from: str = ''
|
start_date_from: str = ''
|
||||||
start_date_to: str = ''
|
start_date_to: str = ''
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
from src.repositories.base_repository import BaseRepository
|
|
||||||
from src.db.sql_condition import SQLCondition
|
|
||||||
from src.db import sql_condition as condition
|
from src.db import sql_condition as condition
|
||||||
|
from src.db.sql_condition import SQLCondition
|
||||||
|
from src.logging.get_logger import get_logger
|
||||||
from src.model.db.master_mente_count import MasterMenteCountModel
|
from src.model.db.master_mente_count import MasterMenteCountModel
|
||||||
from src.model.request.master_mainte_csvdl import MasterMainteCsvDlModel
|
from src.model.request.master_mainte_csvdl import MasterMainteCsvDlModel
|
||||||
|
from src.repositories.base_repository import BaseRepository
|
||||||
from src.util.string_util import is_not_empty
|
from src.util.string_util import is_not_empty
|
||||||
from src.logging.get_logger import get_logger
|
|
||||||
|
|
||||||
logger = get_logger('従業員担当施設マスタ')
|
logger = get_logger('従業員担当施設マスタ')
|
||||||
|
|
||||||
@ -157,6 +157,7 @@ class EmpChgInstRepository(BaseRepository):
|
|||||||
eci.inst_cd AS inst_cd,
|
eci.inst_cd AS inst_cd,
|
||||||
mi.inst_name AS inst_name,
|
mi.inst_name AS inst_name,
|
||||||
eci.ta_cd AS ta_cd,
|
eci.ta_cd AS ta_cd,
|
||||||
|
eci.emp_chg_type_cd AS emp_chg_type_cd,
|
||||||
eci.emp_cd AS emp_cd,
|
eci.emp_cd AS emp_cd,
|
||||||
CONCAT(emp.emp_name_family, " ", emp.emp_name_first) AS emp_name_full,
|
CONCAT(emp.emp_name_family, " ", emp.emp_name_first) AS emp_name_full,
|
||||||
eci.bu_cd AS bu_cd,
|
eci.bu_cd AS bu_cd,
|
||||||
@ -212,6 +213,11 @@ class EmpChgInstRepository(BaseRepository):
|
|||||||
parameter.adapt_emp_cd = f'%{parameter.emp_cd}%'
|
parameter.adapt_emp_cd = f'%{parameter.emp_cd}%'
|
||||||
where_clauses.append(SQLCondition('eci.emp_cd', condition.LIKE, 'adapt_emp_cd'))
|
where_clauses.append(SQLCondition('eci.emp_cd', condition.LIKE, 'adapt_emp_cd'))
|
||||||
|
|
||||||
|
# 担当者種別コードが入力されていた場合
|
||||||
|
if is_not_empty(parameter.emp_chg_type_cd):
|
||||||
|
parameter.adapt_emp_chg_type_cd = f'%{parameter.emp_chg_type_cd}%'
|
||||||
|
where_clauses.append(SQLCondition('eci.emp_chg_type_cd', condition.LIKE, 'adapt_emp_chg_type_cd'))
|
||||||
|
|
||||||
# 適用期間内が入力されていた場合
|
# 適用期間内が入力されていた場合
|
||||||
if is_not_empty(parameter.adapt_apply_date_from):
|
if is_not_empty(parameter.adapt_apply_date_from):
|
||||||
where_clauses.append(SQLCondition('eci.start_date', condition.LE, 'adapt_apply_date_from'))
|
where_clauses.append(SQLCondition('eci.start_date', condition.LE, 'adapt_apply_date_from'))
|
||||||
|
|||||||
@ -164,6 +164,7 @@ MENTE_CSV_DOWNLOAD_EXTRACT_COLUMNS = [
|
|||||||
'inst_cd',
|
'inst_cd',
|
||||||
'inst_name',
|
'inst_name',
|
||||||
'ta_cd',
|
'ta_cd',
|
||||||
|
'emp_chg_type_cd',
|
||||||
'emp_cd',
|
'emp_cd',
|
||||||
'emp_name_full',
|
'emp_name_full',
|
||||||
'bu_cd',
|
'bu_cd',
|
||||||
@ -180,6 +181,7 @@ MENTE_CSV_DOWNLOAD_HEADER = [
|
|||||||
'施設コード',
|
'施設コード',
|
||||||
'施設名',
|
'施設名',
|
||||||
'領域コード',
|
'領域コード',
|
||||||
|
'担当者種別コード',
|
||||||
'MUID',
|
'MUID',
|
||||||
'担当者名',
|
'担当者名',
|
||||||
'ビジネスユニットコード',
|
'ビジネスユニットコード',
|
||||||
|
|||||||
@ -81,6 +81,17 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- 検索フォーム2行目 -->
|
<!-- 検索フォーム2行目 -->
|
||||||
|
<tr>
|
||||||
|
<!-- 担当者種別コード -->
|
||||||
|
<td class="searchLabelTd">担当者種別コード:</td>
|
||||||
|
<td class="searchInputTd">
|
||||||
|
<input class="searchTextbox" type="text" name="ctrl_emp_chg_type_cd" value="{{mainte_csv_dl.emp_chg_type_cd | safe}}" maxlength='10'
|
||||||
|
onchange="formBtDisabled()"
|
||||||
|
oninput="formBtDisabled()"
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- 検索フォーム3行目 -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- 適用期間内 -->
|
<!-- 適用期間内 -->
|
||||||
<td class="searchLabelTd">適用期間内:</td>
|
<td class="searchLabelTd">適用期間内:</td>
|
||||||
@ -117,7 +128,7 @@
|
|||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- 検索フォーム3行目 -->
|
<!-- 検索フォーム4行目 -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- 対象テーブル -->
|
<!-- 対象テーブル -->
|
||||||
<td class="searchLabelTd">対象テーブル:</td>
|
<td class="searchLabelTd">対象テーブル:</td>
|
||||||
@ -160,7 +171,7 @@
|
|||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- 検索フォーム4行目 -->
|
<!-- 検索フォーム5行目 -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- 検索、クリアボタン -->
|
<!-- 検索、クリアボタン -->
|
||||||
<td class="searchButtonTd" colspan="6">
|
<td class="searchButtonTd" colspan="6">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user