feat: datepicker改造対応、レビュー指摘対応

This commit is contained in:
高木要 2023-07-20 09:44:27 +09:00
parent 8329ad0b51
commit a4d38e7395
6 changed files with 29 additions and 29 deletions

View File

@ -286,7 +286,7 @@ async def inst_emp_csv_download(
ta_cd=csv_download_form.ta_cd,
inst_cd=csv_download_form.inst_cd,
emp_cd=csv_download_form.emp_cd,
apply_date=csv_download_form.apply_date,
apply_date_from=csv_download_form.apply_date_from,
start_date_from=csv_download_form.start_date_from,
start_date_to=csv_download_form.start_date_to,
end_date_from=csv_download_form.end_date_from,

View File

@ -16,8 +16,8 @@ class MasterMainteCsvDlModel(RequestBaseModel):
adapt_inst_cd: Optional[str]
emp_cd: Optional[str]
adapt_emp_cd: Optional[str]
apply_date: Optional[str]
adapt_apply_date: Optional[str]
apply_date_from: Optional[str]
adapt_apply_date_from: Optional[str]
start_date_from: Optional[str]
adapt_start_date_from: Optional[str]
start_date_to: Optional[str]
@ -42,7 +42,7 @@ class MasterMainteCsvDlModel(RequestBaseModel):
ctrl_ta_cd: Optional[str] = Form(None),
ctrl_inst_cd: Optional[str] = Form(None),
ctrl_emp_cd: Optional[str] = Form(None),
ctrl_apply_date: Optional[str] = Form(None),
ctrl_apply_date_from: Optional[str] = Form(None),
ctrl_start_date_from: Optional[str] = Form(None),
ctrl_start_date_to: Optional[str] = Form(None),
ctrl_end_date_from: Optional[str] = Form(None),
@ -58,7 +58,7 @@ class MasterMainteCsvDlModel(RequestBaseModel):
ctrl_ta_cd,
ctrl_inst_cd,
ctrl_emp_cd,
ctrl_apply_date,
ctrl_apply_date_from,
ctrl_start_date_from,
ctrl_start_date_to,
ctrl_end_date_from,
@ -75,7 +75,7 @@ class MasterMainteCsvDlModel(RequestBaseModel):
ctrl_ta_cd: str,
ctrl_inst_cd: str,
ctrl_emp_cd: str,
ctrl_apply_date: str,
ctrl_apply_date_from: str,
ctrl_start_date_from: str,
ctrl_start_date_to: str,
ctrl_end_date_from: str,
@ -90,11 +90,11 @@ class MasterMainteCsvDlModel(RequestBaseModel):
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 ''
adapt_apply_date = ''
if is_not_empty(ctrl_apply_date):
adapt_apply_date = ctrl_apply_date.replace('/', '')
adapt_apply_date_from = ''
if is_not_empty(ctrl_apply_date_from):
adapt_apply_date_from = ctrl_apply_date_from.replace('/', '')
else:
ctrl_apply_date = ''
ctrl_apply_date_from = ''
adapt_start_date_from = ''
adapt_start_date_to = ''
@ -147,8 +147,8 @@ class MasterMainteCsvDlModel(RequestBaseModel):
adapt_inst_cd=ctrl_inst_cd,
emp_cd=ctrl_emp_cd,
adapt_emp_cd=ctrl_emp_cd,
apply_date=ctrl_apply_date,
adapt_apply_date=adapt_apply_date,
apply_date_from=ctrl_apply_date_from,
adapt_apply_date_from=adapt_apply_date_from,
start_date_from=ctrl_start_date_from,
adapt_start_date_from=adapt_start_date_from,
start_date_to=ctrl_start_date_to,

View File

@ -9,7 +9,7 @@ class InstEmpCsvDownloadViewModel(BaseModel):
ta_cd: Optional[str] = ''
inst_cd: Optional[str] = ''
emp_cd: Optional[str] = ''
apply_date: Optional[str] = ''
apply_date_from: Optional[str] = ''
start_date_from: Optional[str] = ''
start_date_to: Optional[str] = ''
end_date_from: Optional[str] = ''

View File

@ -219,59 +219,59 @@ class EmpChgInstRepository(BaseRepository):
where_clauses.append(SQLCondition('eci.emp_cd', condition.LIKE, 'adapt_emp_cd'))
# 適用期間内が入力されていた場合
if is_not_empty(parameter.adapt_apply_date):
where_clauses.append(SQLCondition('eci.START_DATE',
if is_not_empty(parameter.adapt_apply_date_from):
where_clauses.append(SQLCondition('eci.start_date',
condition.LE,
'adapt_apply_date'))
where_clauses.append(SQLCondition('eci.END_DATE',
'adapt_apply_date_from'))
where_clauses.append(SQLCondition('eci.end_date',
condition.GE,
'adapt_apply_date'))
'adapt_apply_date_from'))
# 適用開始日FROMが入力されていた場合
if is_not_empty(parameter.adapt_start_date_from):
where_clauses.append(SQLCondition('eci.START_DATE',
where_clauses.append(SQLCondition('eci.start_date',
condition.GE,
'adapt_start_date_from'))
# 適用開始日TOが入力されていた場合
if is_not_empty(parameter.adapt_start_date_to):
where_clauses.append(SQLCondition('eci.START_DATE',
where_clauses.append(SQLCondition('eci.start_date',
condition.LE,
'adapt_start_date_to'))
# 適用終了日FROMが入力されていた場合
if is_not_empty(parameter.adapt_end_date_from):
where_clauses.append(SQLCondition('eci.END_DATE',
where_clauses.append(SQLCondition('eci.end_date',
condition.GE,
'adapt_end_date_from'))
# 適用終了日TOが入力されていた場合
if is_not_empty(parameter.adapt_end_date_to):
where_clauses.append(SQLCondition('eci.END_DATE',
where_clauses.append(SQLCondition('eci.end_date',
condition.LE,
'adapt_end_date_to'))
# データ作成日FROMが入力されていた場合
if is_not_empty(parameter.adapt_create_date_from):
where_clauses.append(SQLCondition('eci.CREATE_DATE',
where_clauses.append(SQLCondition('eci.create_date',
condition.GE,
'adapt_create_date_from'))
# データ作成日TOが入力されていた場合
if is_not_empty(parameter.adapt_create_date_to):
where_clauses.append(SQLCondition('eci.CREATE_DATE',
where_clauses.append(SQLCondition('eci.create_date',
condition.LE,
'adapt_create_date_to'))
# データ作成日FROMが入力されていた場合
if is_not_empty(parameter.adapt_update_date_from):
where_clauses.append(SQLCondition('eci.UPDATE_DATE',
where_clauses.append(SQLCondition('eci.update_date',
condition.GE,
'adapt_update_date_from'))
# データ作成日TOが入力されていた場合
if is_not_empty(parameter.adapt_update_date_to):
where_clauses.append(SQLCondition('eci.UPDATE_DATE',
where_clauses.append(SQLCondition('eci.update_date',
condition.LE,
'adapt_update_date_to'))

View File

@ -13,9 +13,9 @@ class EmpMasterRepository(BaseRepository):
FROM
src05.emp
WHERE
emp.EMP_CD = :emp_cd
emp.emp_cd = :emp_cd
AND str_to_date(emp.start_date, '%Y%m%d') <= str_to_date(:start_work_date, '%Y%m%d')
AND str_to_date(:start_work_date, '%Y%m%d') <= str_to_date(emp.END_DATE ,'%Y%m%d')
AND str_to_date(:start_work_date, '%Y%m%d') <= str_to_date(emp.end_date ,'%Y%m%d')
"""
def fetch_count(self, emp_cd, start_work_date) -> MasterMenteCountModel:

View File

@ -85,7 +85,7 @@
<!-- 適用期間内 -->
<td class="searchLabelTd">適用期間内:</td>
<td class="searchInputTd">
<input class="searchTextbox date_picker" type="text" name="ctrl_apply_date" value="{{mainte_csv_dl.apply_date | safe}}" maxlength='10'
<input class="searchTextbox date_picker" type="text" name="ctrl_apply_date_from" value="{{mainte_csv_dl.apply_date_from | safe}}" maxlength='10'
onchange="formBtDisabled()"
oninput="formBtDisabled()"
>